mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
- little refactor of Hero of Bretagard condition
This commit is contained in:
parent
98f1ed0a4c
commit
03979f77bb
2 changed files with 193 additions and 195 deletions
|
|
@ -0,0 +1,27 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
// @author jeffwadsworth
|
||||
|
||||
public class SourceHasAnyCountersCondition implements Predicate<Permanent> {
|
||||
|
||||
final int count;
|
||||
|
||||
public SourceHasAnyCountersCondition(int count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Permanent input, Game game) {
|
||||
return input.getCounters(game).values().stream().anyMatch(counter -> counter.getCount() >= count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "any counter";
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue