Implemented Role Reversal

This commit is contained in:
Evan Kranzler 2019-04-04 22:15:33 -04:00
parent b22443f422
commit 0b703b1be0
4 changed files with 112 additions and 12 deletions

View file

@ -153,13 +153,18 @@ public interface MageObject extends MageItem, Serializable {
* @return
*/
default boolean shareTypes(Card otherCard) {
return this.shareTypes(otherCard, false);
}
default boolean shareTypes(Card otherCard, boolean permanentOnly) {
if (otherCard == null) {
throw new IllegalArgumentException("Params can't be null");
}
for (CardType type : getCardType()) {
if (otherCard.getCardType().contains(type)) {
if (otherCard.getCardType().contains(type)
&& (!permanentOnly || type.isPermanentType())) {
return true;
}
}