mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Moved predicate to framework.
This commit is contained in:
parent
4cce091dc2
commit
9545ab055d
2 changed files with 37 additions and 26 deletions
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.filter.predicate.other;
|
||||
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.game.stack.StackObject;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
*/
|
||||
public class SpellZonePredicate implements Predicate<StackObject> {
|
||||
|
||||
private final Zone zone;
|
||||
|
||||
public SpellZonePredicate(Zone zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(StackObject input, Game game) {
|
||||
return input instanceof Spell && ((Spell) input).getFromZone().match(zone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SpellZone(" + zone + ')';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue