- little refactor of Hero of Bretagard condition

This commit is contained in:
jeffwadsworth 2021-02-01 17:40:33 -06:00
parent 98f1ed0a4c
commit 03979f77bb
2 changed files with 193 additions and 195 deletions

View file

@ -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";
}
}