Reworking card types in preparation for implementing Grist, the Hunger Tide (#7899)

Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
This commit is contained in:
Evan Kranzler 2021-07-08 23:28:43 -04:00 committed by GitHub
parent 07e1dff10c
commit 572104b8fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1159 changed files with 2704 additions and 2203 deletions

View file

@ -2,9 +2,12 @@ package mage.game;
import mage.MageObject;
import mage.ObjectColor;
import mage.constants.CardType;
import mage.util.SubTypes;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* This class saves changed attributes of mage objects (e.g. in command zone, graveyard, exile or
@ -16,15 +19,18 @@ public class MageObjectAttribute implements Serializable {
protected ObjectColor color;
protected SubTypes subtype;
protected List<CardType> cardType;
public MageObjectAttribute(MageObject mageObject, Game game) {
color = mageObject.getColor().copy();
subtype = new SubTypes(mageObject.getSubtype(game));
cardType = new ArrayList<>(mageObject.getCardType(game));
}
public MageObjectAttribute(MageObjectAttribute mageObjectAttribute) {
this.color = mageObjectAttribute.color;
this.subtype = mageObjectAttribute.subtype;
this.cardType = mageObjectAttribute.cardType;
}
public MageObjectAttribute copy() {
@ -39,4 +45,7 @@ public class MageObjectAttribute implements Serializable {
return subtype;
}
public List<CardType> getCardType() {
return cardType;
}
}