fixed two small refactor errors

This commit is contained in:
Evan Kranzler 2020-09-12 20:56:46 -04:00
parent 8876d39491
commit 29efa7b067
3 changed files with 25 additions and 25 deletions

View file

@ -163,29 +163,6 @@ public enum CounterType {
WIND("wind"),
WISH("wish");
private static class CounterPredicate implements Predicate<Card> {
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<Card> {
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() + ')';
}
}
}