- As Foretold: simplified implementation of copyWithDefinedMana

This commit is contained in:
Agetian
2017-09-10 13:42:16 +00:00
parent f8786bcd47
commit 1d93fccbb3

View File

@@ -515,13 +515,8 @@ public class Cost {
} }
public final Cost copyWithDefinedMana(String manaCost) { public final Cost copyWithDefinedMana(String manaCost) {
Cost toRet = new Cost(0); Cost toRet = copyWithNoMana();
toRet.isAbility = this.isAbility;
toRet.costParts.add(new CostPartMana(new ManaCost(new ManaCostParser(manaCost)), null)); toRet.costParts.add(new CostPartMana(new ManaCost(new ManaCostParser(manaCost)), null));
for (CostPart cp : this.costParts) {
if (!(cp instanceof CostPartMana))
toRet.costParts.add(cp.copy());
}
return toRet; return toRet;
} }