mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Refactoring: replace custom creature tokens with basic class
This commit is contained in:
parent
7d8c9f5b13
commit
69ba8cada4
7 changed files with 76 additions and 105 deletions
|
|
@ -10,7 +10,7 @@ import mage.util.SubTypeList;
|
|||
*
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class CreatureToken extends TokenImpl {
|
||||
public class CreatureToken extends TokenImpl {
|
||||
|
||||
public CreatureToken() {
|
||||
this(0, 0);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
package mage.game.permanent.token.custom;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.permanent.token.TokenImpl;
|
||||
import mage.util.SubTypeList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class ElementalCreatureToken extends TokenImpl {
|
||||
|
||||
public ElementalCreatureToken() {
|
||||
this(0, 0);
|
||||
}
|
||||
|
||||
public ElementalCreatureToken(int power, int toughness) {
|
||||
this(power, toughness, String.format("%d/%d Elemental creature", power, toughness));
|
||||
}
|
||||
|
||||
public ElementalCreatureToken(int power, int toughness, String description) {
|
||||
this(power, toughness, description, (ObjectColor) null);
|
||||
}
|
||||
|
||||
public ElementalCreatureToken(int power, int toughness, String description, ObjectColor color) {
|
||||
super("", description);
|
||||
this.cardType.add(CardType.CREATURE);
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
|
||||
this.power = new MageInt(power);
|
||||
this.toughness = new MageInt(toughness);
|
||||
|
||||
if (color != null) {
|
||||
this.color.addColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
public ElementalCreatureToken(final ElementalCreatureToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public ElementalCreatureToken copy() {
|
||||
return new ElementalCreatureToken(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue