MCPcopy Create free account
hub / github.com/Card-Forge/forge / getMaxForNonManaX

Method getMaxForNonManaX

forge-game/src/main/java/forge/game/cost/Cost.java:1101–1115  ·  view source on GitHub ↗
(final SpellAbility ability, final Player payer, final boolean effect)

Source from the content-addressed store, hash-verified

1099 }
1100
1101 public Integer getMaxForNonManaX(final SpellAbility ability, final Player payer, final boolean effect) {
1102 Integer val = null;
1103 for (CostPart p : getCostParts()) {
1104 if (!p.getAmount().equals("X")) {
1105 continue;
1106 }
1107
1108 val = ObjectUtils.min(val, p.getMaxAmountX(ability, payer, effect));
1109 }
1110 // extra 0 check
1111 if (val != null && val <= 0 && hasManaCost() && getCostMana().getXMin() > 0) {
1112 val = null;
1113 }
1114 return val;
1115 }
1116 public static final Cost Zero = new Cost(0);
1117}

Callers 2

announceRequirementsMethod · 0.95
setMaxXValueMethod · 0.95

Calls 8

getCostPartsMethod · 0.95
hasManaCostMethod · 0.95
getCostManaMethod · 0.95
getXMinMethod · 0.80
getAmountMethod · 0.65
equalsMethod · 0.45
minMethod · 0.45
getMaxAmountXMethod · 0.45

Tested by

no test coverage detected