mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
OptionalCost: add Name to Enum to have Kicker display as the same
OptionalCostValue: add Holder for enum -> cost
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user