add battle card type to main branch

This commit is contained in:
theelk801 2023-04-01 19:36:23 -04:00
parent 4706b695e7
commit 1727ec1fb5
2 changed files with 11 additions and 2 deletions

View file

@ -211,12 +211,20 @@ public interface MageObject extends MageItem, Serializable, Copyable<MageObject>
return getCardType(game).contains(CardType.TRIBAL);
}
default boolean isBattle() {
return isBattle(null);
}
default boolean isBattle(Game game) {
return getCardType(game).contains(CardType.BATTLE);
}
default boolean isPermanent() {
return isCreature() || isArtifact() || isPlaneswalker() || isEnchantment() || isLand();
return isCreature() || isArtifact() || isPlaneswalker() || isEnchantment() || isLand() || isBattle();
}
default boolean isPermanent(Game game) {
return isCreature(game) || isArtifact(game) || isPlaneswalker(game) || isEnchantment(game) || isLand(game);
return isCreature(game) || isArtifact(game) || isPlaneswalker(game) || isEnchantment(game) || isLand(game) || isBattle(game);
}
default boolean isLegendary() {

View file

@ -13,6 +13,7 @@ import java.util.List;
*/
public enum CardType {
ARTIFACT("Artifact", true, true),
BATTLE("Battle", true, true),
CONSPIRACY("Conspiracy", false, false),
CREATURE("Creature", true, true),
DUNGEON("Dungeon", false, false),