From 29efa7b067a747cfd90eee1a51740ac5c96dfd58 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 12 Sep 2020 20:56:46 -0400 Subject: [PATCH] fixed two small refactor errors --- Mage.Sets/src/mage/cards/h/Hindervines.java | 2 +- .../src/mage/cards/o/ObsidianFireheart.java | 2 +- .../main/java/mage/counters/CounterType.java | 46 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Mage.Sets/src/mage/cards/h/Hindervines.java b/Mage.Sets/src/mage/cards/h/Hindervines.java index ec36cbd2ab..d94c8da3e9 100644 --- a/Mage.Sets/src/mage/cards/h/Hindervines.java +++ b/Mage.Sets/src/mage/cards/h/Hindervines.java @@ -20,7 +20,7 @@ public final class Hindervines extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with no +1/+1 counters on them"); static { - filter.add(Predicates.not(CounterType.P1P1).getPredicate()); + filter.add(Predicates.not(CounterType.P1P1.getPredicate())); } public Hindervines(UUID ownerId, CardSetInfo setInfo) { diff --git a/Mage.Sets/src/mage/cards/o/ObsidianFireheart.java b/Mage.Sets/src/mage/cards/o/ObsidianFireheart.java index e0e8ad4e77..4386db5c97 100644 --- a/Mage.Sets/src/mage/cards/o/ObsidianFireheart.java +++ b/Mage.Sets/src/mage/cards/o/ObsidianFireheart.java @@ -39,7 +39,7 @@ public final class ObsidianFireheart extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("land without a blaze counter on it"); static { - filter.add(Predicates.not(CounterType.BLAZE).getPredicate()); + filter.add(Predicates.not(CounterType.BLAZE.getPredicate())); } public ObsidianFireheart(UUID ownerId, CardSetInfo setInfo) { diff --git a/Mage/src/main/java/mage/counters/CounterType.java b/Mage/src/main/java/mage/counters/CounterType.java index a3ed860b63..9492c1d1eb 100644 --- a/Mage/src/main/java/mage/counters/CounterType.java +++ b/Mage/src/main/java/mage/counters/CounterType.java @@ -163,29 +163,6 @@ public enum CounterType { WIND("wind"), WISH("wish"); - private static class CounterPredicate implements Predicate { - - private final CounterType counter; - - private CounterPredicate(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() + ')'; - } - } - private final String name; private final CounterPredicate predicate; @@ -281,4 +258,27 @@ public enum CounterType { public CounterPredicate getPredicate() { return predicate; } + + private static class CounterPredicate implements Predicate { + + private final CounterType counter; + + private CounterPredicate(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() + ')'; + } + } }