diff --git a/Mage.Sets/src/mage/cards/d/DustOfMoments.java b/Mage.Sets/src/mage/cards/d/DustOfMoments.java index faf757fba6..d5534c63a0 100644 --- a/Mage.Sets/src/mage/cards/d/DustOfMoments.java +++ b/Mage.Sets/src/mage/cards/d/DustOfMoments.java @@ -19,7 +19,6 @@ import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.FilterPermanent; -import mage.filter.predicate.permanent.CardCounterPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -69,7 +68,7 @@ public final class DustOfMoments extends CardImpl { permFilter.add(CounterType.TIME.getPredicate()); this.exiledFilter = new FilterCard("permanent and each suspended card"); - exiledFilter.add(new CardCounterPredicate(CounterType.TIME)); + exiledFilter.add(CounterType.TIME.getPredicate()); setText(); } diff --git a/Mage.Sets/src/mage/cards/f/FuryCharm.java b/Mage.Sets/src/mage/cards/f/FuryCharm.java index 1668f4053c..2c9ef3a7c1 100644 --- a/Mage.Sets/src/mage/cards/f/FuryCharm.java +++ b/Mage.Sets/src/mage/cards/f/FuryCharm.java @@ -20,7 +20,6 @@ import mage.constants.Outcome; import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.AbilityPredicate; -import mage.filter.predicate.other.CounterCardPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetArtifactPermanent; @@ -35,7 +34,7 @@ public final class FuryCharm extends CardImpl { private static final FilterCard filter = new FilterCard("suspended card"); static { - filter.add(new CounterCardPredicate(CounterType.TIME)); + filter.add(CounterType.TIME.getPredicate()); filter.add(new AbilityPredicate(SuspendAbility.class)); } diff --git a/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java b/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java index db1fcbb798..3bb82c1374 100644 --- a/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java +++ b/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java @@ -11,7 +11,6 @@ import mage.cards.*; import mage.constants.*; import mage.counters.CounterType; import mage.filter.FilterCard; -import mage.filter.predicate.other.CounterCardPredicate; import mage.game.ExileZone; import mage.game.Game; import mage.game.permanent.token.KarnConstructToken; @@ -125,7 +124,7 @@ class KarnMinus1Effect extends OneShotEffect { private static final FilterCard filter = new FilterCard("card you own with a silver counter on it in exile"); static { - filter.add(new CounterCardPredicate(CounterType.SILVER)); + filter.add(CounterType.SILVER.getPredicate()); } public KarnMinus1Effect() { diff --git a/Mage.Sets/src/mage/cards/m/MaintenanceDroid.java b/Mage.Sets/src/mage/cards/m/MaintenanceDroid.java index 789339bfeb..faae12af41 100644 --- a/Mage.Sets/src/mage/cards/m/MaintenanceDroid.java +++ b/Mage.Sets/src/mage/cards/m/MaintenanceDroid.java @@ -22,7 +22,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterCard; -import mage.filter.predicate.other.CounterCardPredicate; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; @@ -36,7 +35,7 @@ public final class MaintenanceDroid extends CardImpl { private static final FilterCard filter = new FilterCard("target card you own with a repair counter on it"); static { - filter.add(new CounterCardPredicate(CounterType.REPAIR)); + filter.add(CounterType.REPAIR.getPredicate()); } public MaintenanceDroid(UUID ownerId, CardSetInfo setInfo) { diff --git a/Mage.Sets/src/mage/cards/m/MairsilThePretender.java b/Mage.Sets/src/mage/cards/m/MairsilThePretender.java index 3188b78a03..468c40306b 100644 --- a/Mage.Sets/src/mage/cards/m/MairsilThePretender.java +++ b/Mage.Sets/src/mage/cards/m/MairsilThePretender.java @@ -23,7 +23,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; -import mage.filter.predicate.other.CounterCardPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -120,7 +119,7 @@ class MairsilThePretenderGainAbilitiesEffect extends ContinuousEffectImpl { private static final FilterCard filter = new FilterCard(); static { - filter.add(new CounterCardPredicate(CounterType.CAGE)); + filter.add(CounterType.CAGE.getPredicate()); } public MairsilThePretenderGainAbilitiesEffect() { diff --git a/Mage/src/main/java/mage/filter/common/FilterPermanentOrSuspendedCard.java b/Mage/src/main/java/mage/filter/common/FilterPermanentOrSuspendedCard.java index 68689b03f3..e8e047ec00 100644 --- a/Mage/src/main/java/mage/filter/common/FilterPermanentOrSuspendedCard.java +++ b/Mage/src/main/java/mage/filter/common/FilterPermanentOrSuspendedCard.java @@ -40,7 +40,6 @@ import mage.filter.FilterImpl; import mage.filter.FilterInPlay; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.AbilityPredicate; -import mage.filter.predicate.other.CounterCardPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -62,7 +61,7 @@ public class FilterPermanentOrSuspendedCard extends FilterImpl imple permanentFilter = new FilterPermanent(); cardFilter = new FilterCard(); cardFilter.add(new AbilityPredicate(SuspendAbility.class)); - cardFilter.add(new CounterCardPredicate(CounterType.TIME)); + cardFilter.add(CounterType.TIME.getPredicate()); } public FilterPermanentOrSuspendedCard(final FilterPermanentOrSuspendedCard filter) { diff --git a/Mage/src/main/java/mage/filter/predicate/other/CounterCardPredicate.java b/Mage/src/main/java/mage/filter/predicate/other/CounterCardPredicate.java deleted file mode 100644 index 720cbf6aaa..0000000000 --- a/Mage/src/main/java/mage/filter/predicate/other/CounterCardPredicate.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.filter.predicate.other; - -import mage.cards.Card; -import mage.counters.CounterType; -import mage.filter.predicate.Predicate; -import mage.game.Game; - -/** - * - * @author jeffwadsworth - */ -public class CounterCardPredicate implements Predicate { - - private final CounterType counter; - - public CounterCardPredicate(CounterType counter) { - this.counter = counter; - } - - @Override - public boolean apply(Card input, Game game) { - return input.getCounters(game).containsKey(counter); - } - - @Override - public String toString() { - return "CounterType(" + counter.getName() + ')'; - } -} diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/CardCounterPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/CardCounterPredicate.java deleted file mode 100644 index 04fa012340..0000000000 --- a/Mage/src/main/java/mage/filter/predicate/permanent/CardCounterPredicate.java +++ /dev/null @@ -1,36 +0,0 @@ -package mage.filter.predicate.permanent; - -import mage.cards.Card; -import mage.counters.CounterType; -import mage.filter.predicate.Predicate; -import mage.game.Game; - -/** - * Created by glerman on 3/7/15. - */ -public class CardCounterPredicate implements Predicate{ - - private final CounterType counter; - - /** - * - * @param counter if null any counter selects the permanent - */ - public CardCounterPredicate(CounterType counter) { - this.counter = counter; - } - - @Override - public boolean apply(Card input, Game game) { - if (counter == null) { - return !input.getCounters(game).keySet().isEmpty(); - } else { - return input.getCounters(game).containsKey(counter); - } - } - - @Override - public String toString() { - return "CounterType(" + counter.getName() + ')'; - } -}