foul-magics/Mage/src/main/java/mage/game/MageObjectAttribute.java
Evan Kranzler 572104b8fc
Reworking card types in preparation for implementing Grist, the Hunger Tide (#7899)
Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
2021-07-09 07:28:43 +04:00

51 lines
1.3 KiB
Java

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
* player hands or libraries).
*
* @author LevelX2
*/
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() {
return new MageObjectAttribute(this);
}
public ObjectColor getColor() {
return color;
}
public SubTypes getSubtype() {
return subtype;
}
public List<CardType> getCardType() {
return cardType;
}
}