Add Subtype to the CardAttribute Framework

This is a massive change. I’ve refrained from unrelated refactoring
when possible but there are still a lot of changes here.
This commit is contained in:
Samuel Sandeen 2016-08-28 17:30:10 -04:00
parent a1a3c0c6a7
commit 282443c231
272 changed files with 514 additions and 493 deletions

View file

@ -1848,9 +1848,9 @@ public abstract class GameImpl implements Game, Serializable {
Permanent attachment = getPermanent(attachmentId);
if (attachment != null
&& (attachment.getCardType().contains(CardType.CREATURE)
|| !(attachment.getSubtype().contains("Aura")
|| attachment.getSubtype().contains("Equipment")
|| attachment.getSubtype().contains("Fortification")))) {
|| !(attachment.getSubtype(this).contains("Aura")
|| attachment.getSubtype(this).contains("Equipment")
|| attachment.getSubtype(this).contains("Fortification")))) {
if (perm.removeAttachment(attachment.getId(), this)) {
somethingHappened = true;
break;
@ -1875,7 +1875,7 @@ public abstract class GameImpl implements Game, Serializable {
// This is called the "planeswalker uniqueness rule."
if (planeswalkers.size() > 1) { //don't bother checking if less than 2 planeswalkers in play
for (Permanent planeswalker : planeswalkers) {
for (String planeswalkertype : planeswalker.getSubtype()) {
for (String planeswalkertype : planeswalker.getSubtype(this)) {
FilterPlaneswalkerPermanent filterPlaneswalker = new FilterPlaneswalkerPermanent();
filterPlaneswalker.add(new SubtypePredicate(planeswalkertype));
filterPlaneswalker.add(new ControllerIdPredicate(planeswalker.getControllerId()));