[BRC] Implement Rootpath Purifier (ready for review) (#10363)

* refactor check supertype methods

* change supertype to list to match card type

* refactor various subtype methods

* implement mageobjectattribute for supertype

* a few fixes

* [BRC] Implement Rootpath Purifier

* a few extra fixes

* more fixes

* add test for purifier
This commit is contained in:
Evan Kranzler 2023-05-13 10:48:07 -04:00 committed by GitHub
parent a850e3660b
commit 024c3081df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
98 changed files with 489 additions and 238 deletions

View file

@ -38,9 +38,9 @@ public abstract class MageObjectImpl implements MageObject {
private String cardNumber = "";
private int imageNumber = 0;
protected List<SuperType> supertype = new ArrayList<>();
protected List<CardType> cardType = new ArrayList<>();
protected SubTypes subtype = new SubTypes();
protected Set<SuperType> supertype = EnumSet.noneOf(SuperType.class);
protected Abilities<Ability> abilities;
protected String text;
@ -146,7 +146,14 @@ public abstract class MageObjectImpl implements MageObject {
}
@Override
public Set<SuperType> getSuperType() {
public List<SuperType> getSuperType(Game game) {
if (game != null) {
// dynamic
MageObjectAttribute mageObjectAttribute = game.getState().getMageObjectAttribute(getId());
if (mageObjectAttribute != null) {
return mageObjectAttribute.getSuperType();
}
}
return supertype;
}