forked from External/mage
[NCC] Implement several cards (#9328)
Many associated refactors too. See full PR for detail.
This commit is contained in:
parent
b7151cfa58
commit
fd16f2a16b
104 changed files with 6091 additions and 1069 deletions
|
|
@ -0,0 +1,25 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.counters.Counter;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
public enum SourceHasCountersCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
return permanent
|
||||
.getCounters(game)
|
||||
.values()
|
||||
.stream()
|
||||
.mapToInt(Counter::getCount)
|
||||
.anyMatch(x -> x > 0);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue