[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

@ -3,6 +3,7 @@ package mage.game;
import mage.MageObject;
import mage.ObjectColor;
import mage.constants.CardType;
import mage.constants.SuperType;
import mage.util.SubTypes;
import java.io.Serializable;
@ -17,20 +18,23 @@ import java.util.List;
*/
public class MageObjectAttribute implements Serializable {
protected ObjectColor color;
protected SubTypes subtype;
protected List<CardType> cardType;
protected final ObjectColor color;
protected final SubTypes subtype;
protected final List<CardType> cardType;
protected final List<SuperType> superType;
public MageObjectAttribute(MageObject mageObject, Game game) {
color = mageObject.getColor().copy();
subtype = new SubTypes(mageObject.getSubtype(game));
cardType = new ArrayList<>(mageObject.getCardType(game));
superType = new ArrayList<>(mageObject.getSuperType(game));
}
public MageObjectAttribute(MageObjectAttribute mageObjectAttribute) {
this.color = mageObjectAttribute.color;
this.subtype = mageObjectAttribute.subtype;
this.cardType = mageObjectAttribute.cardType;
this.superType = mageObjectAttribute.superType;
}
public MageObjectAttribute copy() {
@ -48,4 +52,8 @@ public class MageObjectAttribute implements Serializable {
public List<CardType> getCardType() {
return cardType;
}
public List<SuperType> getSuperType() {
return superType;
}
}