forked from External/mage
* replaced blocking/blocked by predicates * added test for knight of dusk (currently fails) * added source parameter to filters and everything else that needs it * some changes to various predicates * test fix * small changes to filter code * merge fix * fixed a test failure * small change to Karn, Scion of Urza * removed sourceId from filter methods and other similar places * added new getobject method to fix some test failures * a few more fixes * fixed merge conflicts * merge fix
24 lines
582 B
Java
24 lines
582 B
Java
|
|
package mage.abilities.condition.common;
|
|
|
|
import mage.abilities.Ability;
|
|
import mage.abilities.condition.Condition;
|
|
import mage.filter.FilterPermanent;
|
|
import mage.game.Game;
|
|
|
|
/**
|
|
* @author North
|
|
*/
|
|
public class AnyPlayerControlsCondition implements Condition {
|
|
|
|
private final FilterPermanent filter;
|
|
|
|
public AnyPlayerControlsCondition(FilterPermanent filter) {
|
|
this.filter = filter;
|
|
}
|
|
|
|
@Override
|
|
public boolean apply(Game game, Ability source) {
|
|
return game.getBattlefield().count(filter, source.getControllerId(), source, game) > 0;
|
|
}
|
|
}
|