forked from External/mage
added new helper methods to test for CardType, to get rid of the contains(CardType.XXX) everywhere, put the logic of that in one place and use the interface call
This commit is contained in:
parent
6b20d352ca
commit
5a57731968
69 changed files with 151 additions and 120 deletions
|
|
@ -82,4 +82,34 @@ public interface MageObject extends MageItem, Serializable {
|
|||
|
||||
void setZoneChangeCounter(int value, Game game);
|
||||
|
||||
|
||||
|
||||
default boolean isCreature(){
|
||||
return getCardType().contains(CardType.CREATURE);
|
||||
}
|
||||
|
||||
default boolean isArtifact(){
|
||||
return getCardType().contains(CardType.ARTIFACT);
|
||||
}
|
||||
|
||||
default boolean isLand(){
|
||||
return getCardType().contains(CardType.LAND);
|
||||
}
|
||||
|
||||
default boolean isEnchantment(){
|
||||
return getCardType().contains(CardType.ENCHANTMENT);
|
||||
}
|
||||
|
||||
default boolean isInstant(){
|
||||
return getCardType().contains(CardType.INSTANT);
|
||||
}
|
||||
|
||||
default boolean isSorcery(){
|
||||
return getCardType().contains(CardType.SORCERY);
|
||||
}
|
||||
|
||||
default boolean isPlaneswalker(){
|
||||
return getCardType().contains(CardType.PLANESWALKER);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue