Changed type of CounterPredicate to Permanent

This commit is contained in:
North 2012-07-27 22:06:06 +03:00
parent a5e6fd6322
commit dd0df32e4b
2 changed files with 7 additions and 12 deletions

View file

@ -34,12 +34,12 @@ import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.common.continious.BoostAllEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.abilities.effects.common.continious.BoostAllEffect;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CounterPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.filter.predicate.permanent.CounterPredicate;
/**
*

View file

@ -25,9 +25,8 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.filter.predicate.mageobject;
package mage.filter.predicate.permanent;
import mage.MageObject;
import mage.counters.CounterType;
import mage.filter.predicate.Predicate;
import mage.game.Game;
@ -37,7 +36,7 @@ import mage.game.permanent.Permanent;
*
* @author jeff
*/
public class CounterPredicate implements Predicate<MageObject> {
public class CounterPredicate implements Predicate<Permanent> {
private final CounterType counter;
@ -46,16 +45,12 @@ public class CounterPredicate implements Predicate<MageObject> {
}
@Override
public boolean apply(MageObject input, Game game) {
Permanent permanent = game.getPermanent(input.getId());
if (permanent != null) {
return permanent.getCounters().containsKey(counter);
}
return false;
public boolean apply(Permanent input, Game game) {
return input.getCounters().containsKey(counter);
}
@Override
public String toString() {
return "Counter Type(" + counter.getName() + ')';
return "CounterType(" + counter.getName() + ')';
}
}