diff --git a/Mage.Sets/src/mage/cards/c/CrownOfTheAges.java b/Mage.Sets/src/mage/cards/c/CrownOfTheAges.java index c90707cd962..df45382d5fe 100644 --- a/Mage.Sets/src/mage/cards/c/CrownOfTheAges.java +++ b/Mage.Sets/src/mage/cards/c/CrownOfTheAges.java @@ -40,8 +40,8 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterEnchantmentPermanent; -import mage.filter.predicate.Predicate; import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AttachmentAttachedToCardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.PermanentIdPredicate; import mage.game.Game; @@ -85,31 +85,6 @@ public class CrownOfTheAges extends CardImpl { } } -class AttachmentAttachedToCardTypePredicate implements Predicate { - - private final CardType cardType; - - public AttachmentAttachedToCardTypePredicate(CardType cardType) { - this.cardType = cardType; - } - - @Override - public boolean apply(Permanent input, Game game) { - if (input.getAttachedTo() != null) { - Permanent attachedTo = game.getPermanent(input.getAttachedTo()); - if (attachedTo != null && attachedTo.getCardType().contains(cardType)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return "AttachmentAttachedToCardType(" + cardType + ')'; - } -} - class CrownOfTheAgesEffect extends OneShotEffect { public CrownOfTheAgesEffect() { diff --git a/Mage.Sets/src/mage/cards/k/KitsuneMystic.java b/Mage.Sets/src/mage/cards/k/KitsuneMystic.java index 8aeabd77d52..975b60c9797 100644 --- a/Mage.Sets/src/mage/cards/k/KitsuneMystic.java +++ b/Mage.Sets/src/mage/cards/k/KitsuneMystic.java @@ -43,7 +43,7 @@ import mage.constants.Outcome; import mage.constants.SuperType; import mage.constants.Zone; import mage.filter.common.FilterEnchantmentPermanent; -import mage.filter.predicate.Predicate; +import mage.filter.predicate.mageobject.AttachmentAttachedToCardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; @@ -113,31 +113,6 @@ class AutumnTailKitsuneSage extends Token { } } -class AttachmentAttachedToCardTypePredicate implements Predicate { - - private final CardType cardType; - - public AttachmentAttachedToCardTypePredicate(CardType cardType) { - this.cardType = cardType; - } - - @Override - public boolean apply(Permanent input, Game game) { - if (input.getAttachedTo() != null) { - Permanent attachedTo = game.getPermanent(input.getAttachedTo()); - if (attachedTo != null && attachedTo.getCardType().contains(cardType)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return "AttachmentAttachedToCardType(" + cardType + ')'; - } -} - class AutumnTailEffect extends OneShotEffect { public AutumnTailEffect() { diff --git a/Mage/src/main/java/mage/filter/predicate/mageobject/AttachmentAttachedToCardTypePredicate.java b/Mage/src/main/java/mage/filter/predicate/mageobject/AttachmentAttachedToCardTypePredicate.java new file mode 100644 index 00000000000..943a49d467f --- /dev/null +++ b/Mage/src/main/java/mage/filter/predicate/mageobject/AttachmentAttachedToCardTypePredicate.java @@ -0,0 +1,31 @@ +package mage.filter.predicate.mageobject; + +import mage.constants.CardType; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +public class AttachmentAttachedToCardTypePredicate implements Predicate { + + private final CardType cardType; + + public AttachmentAttachedToCardTypePredicate(CardType cardType) { + this.cardType = cardType; + } + + @Override + public boolean apply(Permanent input, Game game) { + if (input.getAttachedTo() != null) { + Permanent attachedTo = game.getPermanent(input.getAttachedTo()); + if (attachedTo != null && attachedTo.getCardType().contains(cardType)) { + return true; + } + } + return false; + } + + @Override + public String toString() { + return "AttachmentAttachedToCardType(" + cardType + ')'; + } +}