diff --git a/.gitattributes b/.gitattributes index 39fb066080b..8f61c107b38 100644 --- a/.gitattributes +++ b/.gitattributes @@ -662,6 +662,7 @@ forge-game/src/main/java/forge/game/spellability/AbilityStatic.java svneol=nativ forge-game/src/main/java/forge/game/spellability/AbilitySub.java svneol=native#text/plain forge-game/src/main/java/forge/game/spellability/ISpellAbility.java -text forge-game/src/main/java/forge/game/spellability/OptionalCost.java -text +forge-game/src/main/java/forge/game/spellability/OptionalCostValue.java -text svneol=unset#text/plain forge-game/src/main/java/forge/game/spellability/Spell.java svneol=native#text/plain forge-game/src/main/java/forge/game/spellability/SpellAbility.java svneol=native#text/plain forge-game/src/main/java/forge/game/spellability/SpellAbilityCondition.java svneol=native#text/plain diff --git a/forge-game/src/main/java/forge/game/spellability/OptionalCost.java b/forge-game/src/main/java/forge/game/spellability/OptionalCost.java index 604f1b5e703..95ad7ce4d3b 100644 --- a/forge-game/src/main/java/forge/game/spellability/OptionalCost.java +++ b/forge-game/src/main/java/forge/game/spellability/OptionalCost.java @@ -5,12 +5,26 @@ package forge.game.spellability; * */ public enum OptionalCost { - Conspire, - Buyback, - Entwine, - Kicker1, - Kicker2, - Surge, - AltCost, // used by prowl - Generic, // used by "Dragon Presence" and pseudo-kicker cards + Conspire("Conspire"), + Buyback("Buyback"), + Entwine("Entwine"), + Kicker1("Kicker"), + Kicker2("Kicker"), + Retrace("Retrace"), + Surge("Surge"), // no real OptionalCost but used there + AltCost(""), // used by prowl + Generic("Generic"); // used by "Dragon Presence" and pseudo-kicker cards + + private String name; + + OptionalCost(String name) { + this.name = name; + } + + /** + * @return the name + */ + public String getName() { + return name; + } } diff --git a/forge-game/src/main/java/forge/game/spellability/OptionalCostValue.java b/forge-game/src/main/java/forge/game/spellability/OptionalCostValue.java new file mode 100644 index 00000000000..0e29780b72f --- /dev/null +++ b/forge-game/src/main/java/forge/game/spellability/OptionalCostValue.java @@ -0,0 +1,53 @@ +package forge.game.spellability; + +import forge.game.cost.Cost; + +public class OptionalCostValue { + private OptionalCost type; + private Cost cost; + + public OptionalCostValue(OptionalCost type, Cost cost) { + this.type = type; + this.cost = cost; + } + + /** + * @return the type + */ + public OptionalCost getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(OptionalCost type) { + this.type = type; + } + + /** + * @return the cost + */ + public Cost getCost() { + return cost; + } + + /** + * @param cost the cost to set + */ + public void setCost(Cost cost) { + this.cost = cost; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(type.name()); + sb.append(" "); + sb.append(cost.toSimpleString()); + return sb.toString(); + } +}