removed some redundant classes

This commit is contained in:
Evan Kranzler 2020-09-12 21:21:57 -04:00
parent 29efa7b067
commit 5fa660a1d8
8 changed files with 6 additions and 82 deletions

View file

@ -40,7 +40,6 @@ import mage.filter.FilterImpl;
import mage.filter.FilterInPlay;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.filter.predicate.other.CounterCardPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -62,7 +61,7 @@ public class FilterPermanentOrSuspendedCard extends FilterImpl<MageObject> imple
permanentFilter = new FilterPermanent();
cardFilter = new FilterCard();
cardFilter.add(new AbilityPredicate(SuspendAbility.class));
cardFilter.add(new CounterCardPredicate(CounterType.TIME));
cardFilter.add(CounterType.TIME.getPredicate());
}
public FilterPermanentOrSuspendedCard(final FilterPermanentOrSuspendedCard filter) {

View file

@ -1,34 +0,0 @@
/*
* 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() + ')';
}
}

View file

@ -1,36 +0,0 @@
package mage.filter.predicate.permanent;
import mage.cards.Card;
import mage.counters.CounterType;
import mage.filter.predicate.Predicate;
import mage.game.Game;
/**
* Created by glerman on 3/7/15.
*/
public class CardCounterPredicate implements Predicate<Card>{
private final CounterType counter;
/**
*
* @param counter if null any counter selects the permanent
*/
public CardCounterPredicate(CounterType counter) {
this.counter = counter;
}
@Override
public boolean apply(Card input, Game game) {
if (counter == null) {
return !input.getCounters(game).keySet().isEmpty();
} else {
return input.getCounters(game).containsKey(counter);
}
}
@Override
public String toString() {
return "CounterType(" + counter.getName() + ')';
}
}