mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 22:42:03 -08:00
- Added CounterCardPredicate. Used it for Rift Elemental and Fury Charm.
This commit is contained in:
parent
892e1fba92
commit
3c0a3c41b0
3 changed files with 38 additions and 5 deletions
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* 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.cards.Card;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class CounterCardPredicate implements Predicate<Card> {
|
||||
|
||||
private final CounterType counter;
|
||||
|
||||
public CounterCardPredicate(CounterType counter) {
|
||||
this.counter = counter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Card input, Game game) {
|
||||
return input.getCounters(game).containsKey(counter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CounterType(" + counter.getName() + ')';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue