mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
commit
235974f21a
3 changed files with 116 additions and 0 deletions
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
package mage.filter.predicate.permanent;
|
||||
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class ControllerIsActivePlayerPredicate implements Predicate<Permanent> {
|
||||
@Override
|
||||
public boolean apply(Permanent input, Game game) {
|
||||
if(input.getControllerId() == null){
|
||||
return false;
|
||||
}
|
||||
return game.getActivePlayerId().equals(input.getControllerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "controlled by the active player";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue