refactored SupertypePredicate to be part of SuperType

This commit is contained in:
Evan Kranzler 2020-01-06 19:21:27 -05:00
parent d919818daa
commit ecf26585b5
190 changed files with 341 additions and 529 deletions

View file

@ -35,7 +35,6 @@ import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.combat.Combat;
import mage.game.command.CommandObject;
@ -2133,7 +2132,7 @@ public abstract class GameImpl implements Game, Serializable {
if (legendary.size() > 1) { //don't bother checking if less than 2 legends in play
for (Permanent legend : legendary) {
FilterPermanent filterLegendName = new FilterPermanent();
filterLegendName.add(new SupertypePredicate(SuperType.LEGENDARY));
filterLegendName.add(SuperType.LEGENDARY.getPredicate());
filterLegendName.add(new NamePredicate(legend.getName()));
filterLegendName.add(new ControllerIdPredicate(legend.getControllerId()));
if (getBattlefield().contains(filterLegendName, legend.getControllerId(), this, 2)) {