forked from External/mage
This is a massive change. I’ve refrained from unrelated refactoring when possible but there are still a lot of changes here.
46 lines
1.1 KiB
Java
46 lines
1.1 KiB
Java
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
package mage.game;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import mage.ObjectColor;
|
|
import mage.cards.Card;
|
|
|
|
/**
|
|
* This class saves changed attributes of cards (e.g. in graveyard, exile or player hands or libraries).
|
|
*
|
|
* @author LevelX2
|
|
*/
|
|
public class CardAttribute implements Serializable {
|
|
|
|
protected ObjectColor color;
|
|
protected List<String> subtype;
|
|
|
|
public CardAttribute(Card card) {
|
|
color = card.getColor(null).copy();
|
|
subtype = new ArrayList<String>(card.getSubtype(null));
|
|
}
|
|
|
|
public CardAttribute(CardAttribute cardAttribute) {
|
|
this.color = cardAttribute.color;
|
|
this.subtype = cardAttribute.subtype;
|
|
}
|
|
|
|
public CardAttribute copy() {
|
|
return new CardAttribute(this);
|
|
}
|
|
|
|
public ObjectColor getColor() {
|
|
return color;
|
|
}
|
|
|
|
public List<String> getSubtype() {
|
|
return subtype;
|
|
}
|
|
|
|
}
|