mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
CardPredicates: add more Predicates for Counters
This commit is contained in:
@@ -245,11 +245,24 @@ public final class CardPredicates {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Predicate<Card> hasCounter(final CounterType type) {
|
public static final Predicate<Card> hasCounters() {
|
||||||
return new Predicate<Card>() {
|
return new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
return c.getCounters(type) > 0;
|
return c.hasCounters();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Predicate<Card> hasCounter(final CounterType type) {
|
||||||
|
return hasCounter(type, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Predicate<Card> hasCounter(final CounterType type, final int n) {
|
||||||
|
return new Predicate<Card>() {
|
||||||
|
@Override
|
||||||
|
public boolean apply(final Card c) {
|
||||||
|
return c.getCounters(type) >= n;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user