mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48: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/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/ISpellAbility.java -text
|
||||||
forge-game/src/main/java/forge/game/spellability/OptionalCost.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/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/SpellAbility.java svneol=native#text/plain
|
||||||
forge-game/src/main/java/forge/game/spellability/SpellAbilityCondition.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 {
|
public enum OptionalCost {
|
||||||
Conspire,
|
Conspire("Conspire"),
|
||||||
Buyback,
|
Buyback("Buyback"),
|
||||||
Entwine,
|
Entwine("Entwine"),
|
||||||
Kicker1,
|
Kicker1("Kicker"),
|
||||||
Kicker2,
|
Kicker2("Kicker"),
|
||||||
Surge,
|
Retrace("Retrace"),
|
||||||
AltCost, // used by prowl
|
Surge("Surge"), // no real OptionalCost but used there
|
||||||
Generic, // used by "Dragon Presence" and pseudo-kicker cards
|
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