Refactoring: replace custom creature tokens with basic class

This commit is contained in:
Oleg Agafonov 2018-05-05 19:18:12 +04:00
parent 7d8c9f5b13
commit 69ba8cada4
7 changed files with 76 additions and 105 deletions

View file

@ -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);

View file

@ -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);
}
}