refactored all usages of CardTypePredicate to match the new implementation

This commit is contained in:
Evan Kranzler 2020-01-06 13:18:17 -05:00
parent f685ee3d69
commit 688be783aa
1069 changed files with 1619 additions and 2732 deletions

View file

@ -15,7 +15,6 @@ import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCardInLibrary;
@ -42,7 +41,7 @@ public class FetchLandActivatedAbility extends ActivatedAbilityImpl {
}
addCost(new SacrificeSourceCost());
FilterCard filter = new FilterCard(subTypeNames(subtypes));
filter.add(new CardTypePredicate(CardType.LAND));
filter.add(CardType.LAND.getPredicate());
List<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
for (SubType subtype : subtypes) {
subtypePredicates.add(new SubtypePredicate(subtype));

View file

@ -9,7 +9,6 @@ import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -43,8 +42,8 @@ class LegendarySpellAbilityCheckEffect extends ContinuousRuleModifyingEffectImpl
Predicates.and(
new SupertypePredicate(SuperType.LEGENDARY),
Predicates.or(
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.PLANESWALKER)
CardType.CREATURE.getPredicate(),
CardType.PLANESWALKER.getPredicate()
)
)
);

View file

@ -4,7 +4,6 @@ import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
/**
@ -17,7 +16,7 @@ public enum MetalcraftCondition implements Condition {
private static final FilterPermanent filter = new FilterPermanent("artifact");
static {
filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.add(CardType.ARTIFACT.getPredicate());
}

View file

@ -10,7 +10,6 @@ import mage.abilities.condition.Condition;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.players.Player;
@ -25,7 +24,7 @@ public enum SpellMasteryCondition implements Condition {
private static final FilterCard filter = new FilterCard();
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
filter.add(Predicates.or(CardType.INSTANT.getPredicate(), CardType.SORCERY.getPredicate()));
}
@Override

View file

@ -21,7 +21,6 @@ import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
@ -97,7 +96,7 @@ public class ChampionAbility extends StaticAbility {
filter.add(Predicates.or(subtypesPredicates));
}
if (requiresCreature) {
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(CardType.CREATURE.getPredicate());
}
filter.add(AnotherPredicate.instance);

View file

@ -17,7 +17,6 @@ import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SharesColorWithSourcePredicate;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.game.Game;
@ -56,7 +55,7 @@ public class ConspireAbility extends StaticAbility implements OptionalAdditional
static {
filter.add(Predicates.not(TappedPredicate.instance));
filter.add(new SharesColorWithSourcePredicate());
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(CardType.CREATURE.getPredicate());
}
public enum ConspireTargets {

View file

@ -14,7 +14,6 @@ import mage.constants.Outcome;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterArtifactPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
@ -43,7 +42,7 @@ public class ModularAbility extends DiesTriggeredAbility {
private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact creature");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(CardType.CREATURE.getPredicate());
}
private int amount;
private boolean sunburst;
@ -136,7 +135,7 @@ class ModularDistributeCounterEffect extends OneShotEffect {
private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact creature");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(CardType.CREATURE.getPredicate());
}
public ModularDistributeCounterEffect() {

View file

@ -8,7 +8,6 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -19,7 +18,7 @@ public class ProwessAbility extends SpellCastControllerTriggeredAbility {
private static final FilterSpell filterNonCreatureSpell = new FilterSpell("noncreature spell");
static {
filterNonCreatureSpell.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
filterNonCreatureSpell.add(Predicates.not(CardType.CREATURE.getPredicate()));
}
public ProwessAbility() {

View file

@ -11,7 +11,6 @@ import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.filter.common.*;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.MulticoloredPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
@ -228,7 +227,7 @@ public final class StaticFilters {
public static final FilterControlledArtifactPermanent FILTER_ARTIFACTS_NON_CREATURE = new FilterControlledArtifactPermanent("Noncreature artifacts");
static {
FILTER_ARTIFACTS_NON_CREATURE.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
FILTER_ARTIFACTS_NON_CREATURE.add(Predicates.not(CardType.CREATURE.getPredicate()));
FILTER_ARTIFACTS_NON_CREATURE.setLockedFilter(true);
}
@ -236,8 +235,8 @@ public final class StaticFilters {
static {
FILTER_PERMANENT_ARTIFACT_OR_CREATURE.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE)
CardType.ARTIFACT.getPredicate(),
CardType.CREATURE.getPredicate()
));
FILTER_PERMANENT_ARTIFACT_OR_CREATURE.setLockedFilter(true);
}
@ -246,9 +245,9 @@ public final class StaticFilters {
static {
FILTER_PERMANENT_ARTIFACT_CREATURE_OR_ENCHANTMENT.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.ENCHANTMENT)
CardType.ARTIFACT.getPredicate(),
CardType.CREATURE.getPredicate(),
CardType.ENCHANTMENT.getPredicate()
));
FILTER_PERMANENT_ARTIFACT_CREATURE_OR_ENCHANTMENT.setLockedFilter(true);
}
@ -257,10 +256,10 @@ public final class StaticFilters {
static {
FILTER_PERMANENT_ARTIFACT_CREATURE_ENCHANTMENT_OR_LAND.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.ENCHANTMENT),
new CardTypePredicate(CardType.LAND)
CardType.ARTIFACT.getPredicate(),
CardType.CREATURE.getPredicate(),
CardType.ENCHANTMENT.getPredicate(),
CardType.LAND.getPredicate()
));
FILTER_PERMANENT_ARTIFACT_CREATURE_ENCHANTMENT_OR_LAND.setLockedFilter(true);
}
@ -287,8 +286,8 @@ public final class StaticFilters {
static {
FILTER_CONTROLLED_PERMANENT_ARTIFACT_OR_CREATURE.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE)
CardType.ARTIFACT.getPredicate(),
CardType.CREATURE.getPredicate()
));
FILTER_CONTROLLED_PERMANENT_ARTIFACT_OR_CREATURE.setLockedFilter(true);
}
@ -323,7 +322,7 @@ public final class StaticFilters {
static {
FILTER_OPPONENTS_PERMANENT_ARTIFACT.add(new ControllerPredicate(TargetController.OPPONENT));
FILTER_OPPONENTS_PERMANENT_ARTIFACT.add(new CardTypePredicate(CardType.ARTIFACT));
FILTER_OPPONENTS_PERMANENT_ARTIFACT.add(CardType.ARTIFACT.getPredicate());
FILTER_OPPONENTS_PERMANENT_ARTIFACT.setLockedFilter(true);
}
@ -332,8 +331,8 @@ public final class StaticFilters {
static {
FILTER_OPPONENTS_PERMANENT_ARTIFACT_OR_CREATURE.add(new ControllerPredicate(TargetController.OPPONENT));
FILTER_OPPONENTS_PERMANENT_ARTIFACT_OR_CREATURE.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE)
CardType.ARTIFACT.getPredicate(),
CardType.CREATURE.getPredicate()
));
FILTER_OPPONENTS_PERMANENT_ARTIFACT_OR_CREATURE.setLockedFilter(true);
}
@ -374,7 +373,7 @@ public final class StaticFilters {
static {
FILTER_CONTROLLED_PERMANENT_NON_LAND.add(
Predicates.not(new CardTypePredicate(CardType.LAND))
Predicates.not(CardType.LAND.getPredicate())
);
FILTER_CONTROLLED_PERMANENT_NON_LAND.setLockedFilter(true);
}
@ -426,7 +425,7 @@ public final class StaticFilters {
static {
FILTER_PERMANENT_CREATURE_OR_PLANESWALKER_A.add(
Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.PLANESWALKER)));
Predicates.or(CardType.CREATURE.getPredicate(), CardType.PLANESWALKER.getPredicate()));
FILTER_PERMANENT_CREATURE_OR_PLANESWALKER_A.setLockedFilter(true);
}
@ -517,13 +516,13 @@ public final class StaticFilters {
FILTER_SPELL_CREATURE.setLockedFilter(true);
}
public static final FilterSpell FILTER_SPELL_NON_CREATURE = (FilterSpell) new FilterSpell("noncreature spell").add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
public static final FilterSpell FILTER_SPELL_NON_CREATURE = (FilterSpell) new FilterSpell("noncreature spell").add(Predicates.not(CardType.CREATURE.getPredicate()));
static {
FILTER_SPELL_NON_CREATURE.setLockedFilter(true);
}
public static final FilterSpell FILTER_SPELL_A_NON_CREATURE = (FilterSpell) new FilterSpell("a noncreature spell").add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
public static final FilterSpell FILTER_SPELL_A_NON_CREATURE = (FilterSpell) new FilterSpell("a noncreature spell").add(Predicates.not(CardType.CREATURE.getPredicate()));
static {
FILTER_SPELL_A_NON_CREATURE.setLockedFilter(true);
@ -552,8 +551,8 @@ public final class StaticFilters {
static {
FILTER_SPELL_AN_INSTANT_OR_SORCERY.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)
CardType.INSTANT.getPredicate(),
CardType.SORCERY.getPredicate()
));
FILTER_SPELL_AN_INSTANT_OR_SORCERY.setLockedFilter(true);
}
@ -562,8 +561,8 @@ public final class StaticFilters {
static {
FILTER_SPELL_INSTANT_OR_SORCERY.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)
CardType.INSTANT.getPredicate(),
CardType.SORCERY.getPredicate()
));
FILTER_SPELL_INSTANT_OR_SORCERY.setLockedFilter(true);
}
@ -572,8 +571,8 @@ public final class StaticFilters {
static {
FILTER_SPELLS_INSTANT_OR_SORCERY.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)
CardType.INSTANT.getPredicate(),
CardType.SORCERY.getPredicate()
));
FILTER_SPELLS_INSTANT_OR_SORCERY.setLockedFilter(true);
}
@ -595,7 +594,7 @@ public final class StaticFilters {
public static final FilterPermanent FILTER_PERMANENT_AURA = new FilterPermanent();
static {
FILTER_PERMANENT_AURA.add(new CardTypePredicate(CardType.ENCHANTMENT));
FILTER_PERMANENT_AURA.add(CardType.ENCHANTMENT.getPredicate());
FILTER_PERMANENT_AURA.add(new SubtypePredicate(SubType.AURA));
FILTER_PERMANENT_AURA.setLockedFilter(true);
}
@ -603,7 +602,7 @@ public final class StaticFilters {
public static final FilterPermanent FILTER_PERMANENT_EQUIPMENT = new FilterPermanent();
static {
FILTER_PERMANENT_EQUIPMENT.add(new CardTypePredicate(CardType.ARTIFACT));
FILTER_PERMANENT_EQUIPMENT.add(CardType.ARTIFACT.getPredicate());
FILTER_PERMANENT_EQUIPMENT.add(new SubtypePredicate(SubType.EQUIPMENT));
FILTER_PERMANENT_EQUIPMENT.setLockedFilter(true);
}
@ -611,7 +610,7 @@ public final class StaticFilters {
public static final FilterPermanent FILTER_PERMANENT_FORTIFICATION = new FilterPermanent();
static {
FILTER_PERMANENT_FORTIFICATION.add(new CardTypePredicate(CardType.ARTIFACT));
FILTER_PERMANENT_FORTIFICATION.add(CardType.ARTIFACT.getPredicate());
FILTER_PERMANENT_FORTIFICATION.add(new SubtypePredicate(SubType.FORTIFICATION));
FILTER_PERMANENT_FORTIFICATION.setLockedFilter(true);
}
@ -627,8 +626,8 @@ public final class StaticFilters {
static {
FILTER_CARD_ARTIFACT_OR_CREATURE.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE)
CardType.ARTIFACT.getPredicate(),
CardType.CREATURE.getPredicate()
));
FILTER_CARD_ARTIFACT_OR_CREATURE.setLockedFilter(true);
}

View file

@ -4,7 +4,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -18,7 +17,7 @@ public class FilterArtifactCard extends FilterCard {
public FilterArtifactCard(String name) {
super(name);
this.add(new CardTypePredicate(CardType.ARTIFACT));
this.add(CardType.ARTIFACT.getPredicate());
}
public FilterArtifactCard(final FilterArtifactCard filter) {

View file

@ -2,7 +2,6 @@
package mage.filter.common;
import mage.constants.CardType;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -16,7 +15,7 @@ public class FilterArtifactCreaturePermanent extends FilterCreaturePermanent {
public FilterArtifactCreaturePermanent(String name) {
super(name);
this.add(new CardTypePredicate(CardType.ARTIFACT));
this.add(CardType.ARTIFACT.getPredicate());
}
public FilterArtifactCreaturePermanent(final FilterArtifactCreaturePermanent filter) {

View file

@ -4,7 +4,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -18,7 +17,7 @@ public class FilterArtifactOrEnchantmentCard extends FilterCard {
public FilterArtifactOrEnchantmentCard(String name) {
super(name);
this.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.ENCHANTMENT)));
this.add(Predicates.or(CardType.ARTIFACT.getPredicate(), CardType.ENCHANTMENT.getPredicate()));
}
public FilterArtifactOrEnchantmentCard(final FilterArtifactOrEnchantmentCard filter) {

View file

@ -4,7 +4,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -18,7 +17,7 @@ public class FilterArtifactOrEnchantmentPermanent extends FilterPermanent {
public FilterArtifactOrEnchantmentPermanent(String name) {
super(name);
this.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.ENCHANTMENT)));
this.add(Predicates.or(CardType.ARTIFACT.getPredicate(), CardType.ENCHANTMENT.getPredicate()));
}
public FilterArtifactOrEnchantmentPermanent(final FilterArtifactOrEnchantmentPermanent filter) {

View file

@ -4,7 +4,7 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -18,7 +18,7 @@ public class FilterArtifactPermanent extends FilterPermanent {
public FilterArtifactPermanent(String name) {
super(name);
this.add(new CardTypePredicate(CardType.ARTIFACT));
this.add(CardType.ARTIFACT.getPredicate());
}
public FilterArtifactPermanent(final FilterArtifactPermanent filter) {

View file

@ -3,7 +3,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -17,6 +16,6 @@ public class FilterArtifactSpell extends FilterSpell {
public FilterArtifactSpell(String name) {
super(name);
this.add(new CardTypePredicate(CardType.ARTIFACT));
this.add(CardType.ARTIFACT.getPredicate());
}
}

View file

@ -4,7 +4,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.constants.SuperType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
/**
@ -19,7 +18,7 @@ public class FilterBasicLandCard extends FilterCard {
public FilterBasicLandCard(String name) {
super(name);
this.add(new CardTypePredicate(CardType.LAND));
this.add(CardType.LAND.getPredicate());
this.add(new SupertypePredicate(SuperType.BASIC));
}

View file

@ -2,7 +2,6 @@
package mage.filter.common;
import mage.constants.CardType;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -18,7 +17,7 @@ public class FilterControlledArtifactPermanent extends FilterControlledPermanent
public FilterControlledArtifactPermanent(String name) {
super(name);
this.add(new CardTypePredicate(CardType.ARTIFACT));
this.add(CardType.ARTIFACT.getPredicate());
}
public FilterControlledArtifactPermanent(final FilterControlledArtifactPermanent filter) {

View file

@ -3,7 +3,7 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
@ -27,7 +27,7 @@ public class FilterControlledCreaturePermanent extends FilterControlledPermanent
public FilterControlledCreaturePermanent(SubType subtype, String name) {
super(name);
this.add(new CardTypePredicate(CardType.CREATURE));
this.add(CardType.CREATURE.getPredicate());
if(subtype != null) {
this.add(new SubtypePredicate(subtype));
}

View file

@ -2,7 +2,6 @@
package mage.filter.common;
import mage.constants.CardType;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -21,7 +20,7 @@ public class FilterControlledEnchantmentPermanent extends FilterControlledPerman
*/
public FilterControlledEnchantmentPermanent(String name) {
super(name);
this.add(new CardTypePredicate(CardType.ENCHANTMENT));
this.add(CardType.ENCHANTMENT.getPredicate());
}
public FilterControlledEnchantmentPermanent(final FilterControlledEnchantmentPermanent filter) {

View file

@ -3,7 +3,6 @@
package mage.filter.common;
import mage.constants.CardType;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -17,7 +16,7 @@ public class FilterControlledLandPermanent extends FilterControlledPermanent {
public FilterControlledLandPermanent(String name) {
super(name);
this.add(new CardTypePredicate(CardType.LAND));
this.add(CardType.LAND.getPredicate());
}
public FilterControlledLandPermanent(final FilterControlledLandPermanent filter) {

View file

@ -2,7 +2,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
@ -20,13 +19,13 @@ public class FilterControlledPlaneswalkerPermanent extends FilterControlledPerma
public FilterControlledPlaneswalkerPermanent(SubType subType, String name) {
super(name);
this.add(new CardTypePredicate(CardType.PLANESWALKER));
this.add(CardType.PLANESWALKER.getPredicate());
this.add(new SubtypePredicate(subType));
}
public FilterControlledPlaneswalkerPermanent(String name) {
super(name);
this.add(new CardTypePredicate(CardType.PLANESWALKER));
this.add(CardType.PLANESWALKER.getPredicate());
}
public FilterControlledPlaneswalkerPermanent(final FilterControlledPlaneswalkerPermanent filter) {

View file

@ -4,7 +4,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -18,7 +17,7 @@ public class FilterCreatureCard extends FilterCard {
public FilterCreatureCard(String name) {
super(name);
this.add(new CardTypePredicate(CardType.CREATURE));
this.add(CardType.CREATURE.getPredicate());
}
public FilterCreatureCard(final FilterCreatureCard filter) {

View file

@ -5,7 +5,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -20,8 +19,8 @@ public class FilterCreatureOrPlaneswalkerPermanent extends FilterPermanent {
public FilterCreatureOrPlaneswalkerPermanent(String name) {
super(name);
this.add(Predicates.or(
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.PLANESWALKER)));
CardType.CREATURE.getPredicate(),
CardType.PLANESWALKER.getPredicate()));
}
public FilterCreatureOrPlaneswalkerPermanent(final FilterCreatureOrPlaneswalkerPermanent filter) {

View file

@ -5,7 +5,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
@ -20,12 +19,12 @@ public class FilterCreaturePermanent extends FilterPermanent {
public FilterCreaturePermanent(String name) {
super(name);
this.add(new CardTypePredicate(CardType.CREATURE));
this.add(CardType.CREATURE.getPredicate());
}
public FilterCreaturePermanent(SubType subtype, String name) {
super(name);
this.add(new CardTypePredicate(CardType.CREATURE));
this.add(CardType.CREATURE.getPredicate());
this.add(new SubtypePredicate(subtype));
}

View file

@ -6,7 +6,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -20,7 +19,7 @@ public class FilterCreatureSpell extends FilterSpell {
public FilterCreatureSpell(String name) {
super(name);
this.add(new CardTypePredicate(CardType.CREATURE));
this.add(CardType.CREATURE.getPredicate());
}
}

View file

@ -3,7 +3,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -17,7 +16,7 @@ public class FilterEnchantmentCard extends FilterCard {
public FilterEnchantmentCard(String name) {
super(name);
this.add(new CardTypePredicate(CardType.ENCHANTMENT));
this.add(CardType.ENCHANTMENT.getPredicate());
}
public FilterEnchantmentCard(final FilterEnchantmentCard filter) {

View file

@ -4,7 +4,6 @@
package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -18,7 +17,7 @@ public class FilterEnchantmentPermanent extends FilterPermanent {
public FilterEnchantmentPermanent(String name) {
super(name);
this.add(new CardTypePredicate(CardType.ENCHANTMENT));
this.add(CardType.ENCHANTMENT.getPredicate());
}
public FilterEnchantmentPermanent(final FilterEnchantmentPermanent filter) {

View file

@ -7,7 +7,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -22,7 +21,7 @@ public class FilterInstantOrSorceryCard extends FilterCard {
public FilterInstantOrSorceryCard(String name) {
super(name);
this.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
this.add(Predicates.or(CardType.INSTANT.getPredicate(), CardType.SORCERY.getPredicate()));
}
public FilterInstantOrSorceryCard(final FilterInstantOrSorceryCard filter) {

View file

@ -4,7 +4,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -19,7 +18,7 @@ public class FilterInstantOrSorcerySpell extends FilterSpell {
public FilterInstantOrSorcerySpell(String name) {
super(name);
this.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
this.add(Predicates.or(CardType.INSTANT.getPredicate(), CardType.SORCERY.getPredicate()));
}
public FilterInstantOrSorcerySpell(final FilterInstantOrSorcerySpell filter) {

View file

@ -5,7 +5,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.constants.SuperType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
/**
@ -20,7 +19,7 @@ public class FilterLandCard extends FilterCard {
public FilterLandCard(String name) {
super(name);
this.add(new CardTypePredicate(CardType.LAND));
this.add(CardType.LAND.getPredicate());
}
public static FilterLandCard basicLandCard() {

View file

@ -7,7 +7,6 @@ import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
@ -22,12 +21,12 @@ public class FilterLandPermanent extends FilterPermanent {
public FilterLandPermanent(String name) {
super(name);
this.add(new CardTypePredicate(CardType.LAND));
this.add(CardType.LAND.getPredicate());
}
public FilterLandPermanent(SubType subtype, String name) {
super(name);
this.add(new CardTypePredicate(CardType.LAND));
this.add(CardType.LAND.getPredicate());
this.add(new SubtypePredicate(subtype));
}

View file

@ -3,7 +3,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
* @author ssouders412
@ -16,7 +15,7 @@ public class FilterNoncreatureCard extends FilterCard {
public FilterNoncreatureCard(String name) {
super(name);
this.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
this.add(Predicates.not(CardType.CREATURE.getPredicate()));
}
public FilterNoncreatureCard(final FilterNoncreatureCard filter) {

View file

@ -5,7 +5,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -19,7 +18,7 @@ public class FilterNonlandCard extends FilterCard {
public FilterNonlandCard(String name) {
super(name);
this.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
this.add(Predicates.not(CardType.LAND.getPredicate()));
}
public FilterNonlandCard(final FilterNonlandCard filter) {

View file

@ -5,7 +5,7 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -19,7 +19,7 @@ public class FilterNonlandPermanent extends FilterPermanent {
public FilterNonlandPermanent(String name) {
super(name);
this.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
this.add(Predicates.not(CardType.LAND.getPredicate()));
}
public FilterNonlandPermanent(final FilterNonlandPermanent filter) {

View file

@ -5,7 +5,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -21,11 +20,11 @@ public class FilterPermanentCard extends FilterCard {
super(name);
this.add(
Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.ENCHANTMENT),
new CardTypePredicate(CardType.LAND),
new CardTypePredicate(CardType.PLANESWALKER)));
CardType.ARTIFACT.getPredicate(),
CardType.CREATURE.getPredicate(),
CardType.ENCHANTMENT.getPredicate(),
CardType.LAND.getPredicate(),
CardType.PLANESWALKER.getPredicate()));
}
public FilterPermanentCard(final FilterPermanentCard filter) {

View file

@ -4,7 +4,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -18,7 +17,7 @@ public class FilterPlaneswalkerCard extends FilterCard {
public FilterPlaneswalkerCard(String name) {
super(name);
this.add(new CardTypePredicate(CardType.PLANESWALKER));
this.add(CardType.PLANESWALKER.getPredicate());
}
public FilterPlaneswalkerCard(final FilterPlaneswalkerCard filter) {

View file

@ -5,7 +5,6 @@ package mage.filter.common;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
@ -24,7 +23,7 @@ public class FilterPlaneswalkerPermanent extends FilterPermanent {
public FilterPlaneswalkerPermanent(String name) {
super(name);
this.add(new CardTypePredicate(CardType.PLANESWALKER));
this.add(CardType.PLANESWALKER.getPredicate());
}
public FilterPlaneswalkerPermanent(final FilterPlaneswalkerPermanent filter) {

View file

@ -10,7 +10,6 @@ import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.command.Emblem;
/**
@ -22,10 +21,10 @@ public final class ElspethKnightErrantEmblem extends Emblem {
this.setName("Emblem Elspeth");
FilterControlledPermanent filter = new FilterControlledPermanent("Artifacts, creatures, enchantments, and lands you control");
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.ENCHANTMENT),
new CardTypePredicate(CardType.LAND)));
CardType.ARTIFACT.getPredicate(),
CardType.CREATURE.getPredicate(),
CardType.ENCHANTMENT.getPredicate(),
CardType.LAND.getPredicate()));
Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter, false);
effect.setText("Artifacts, creatures, enchantments, and lands you control have indestructible");
this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, effect));

View file

@ -18,7 +18,6 @@ import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.EnchantedPredicate;
import mage.game.command.Plane;
import mage.target.Target;
@ -36,7 +35,7 @@ public class AkoumPlane extends Plane {
static {
filter.add(Predicates.not(EnchantedPredicate.instance));
filterCard.add(new CardTypePredicate(CardType.ENCHANTMENT));
filterCard.add(CardType.ENCHANTMENT.getPredicate());
}
public AkoumPlane() {

View file

@ -26,7 +26,6 @@ import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterInstantOrSorceryCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.command.Plane;
import mage.game.stack.Spell;
@ -45,7 +44,7 @@ public class TrailOfTheMageRingsPlane extends Plane {
private static final FilterCard filter = new FilterCard("creature spells");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(CardType.CREATURE.getPredicate());
}
public TrailOfTheMageRingsPlane() {
@ -78,7 +77,7 @@ class TrailOfTheMageRingsReboundEffect extends ContinuousEffectImpl {
protected static final FilterCard filter = new FilterCard("Instant and sorcery spells");
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
filter.add(Predicates.or(CardType.INSTANT.getPredicate(), CardType.SORCERY.getPredicate()));
}
public TrailOfTheMageRingsReboundEffect() {

View file

@ -13,7 +13,6 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect;
import mage.abilities.effects.common.RollPlanarDieEffect;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.abilities.effects.common.cost.SpellsCostReductionAllEffect;
import mage.cards.Card;
import mage.constants.CardType;
import mage.constants.CostModificationType;
@ -23,7 +22,6 @@ import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.command.Plane;
import mage.game.stack.Spell;
@ -67,7 +65,7 @@ class TurriIslandEffect extends CostModificationEffectImpl {
private static final FilterCard filter = new FilterCard("creature spells");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(CardType.CREATURE.getPredicate());
}
private static final String rule = "Creature spells cost {2} less to cast";

View file

@ -20,7 +20,6 @@ import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.command.Plane;
import mage.game.events.DamagedPlayerEvent;
@ -40,7 +39,7 @@ public class UndercityReachesPlane extends Plane {
private static final FilterCard filter = new FilterCard("creature spells");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(CardType.CREATURE.getPredicate());
}
public UndercityReachesPlane() {

View file

@ -17,10 +17,8 @@ import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
@ -71,7 +69,7 @@ class BelzenlokDemonTokenEffect extends OneShotEffect {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("another creature");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(CardType.CREATURE.getPredicate());
filter.add(AnotherPredicate.instance);
}

View file

@ -10,7 +10,6 @@ import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import java.util.ArrayList;
import java.util.Arrays;
@ -24,7 +23,7 @@ public final class KarnConstructToken extends TokenImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifacts you control");
static {
filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.add(CardType.ARTIFACT.getPredicate());
}
static final private List<String> tokenImageSets = new ArrayList<>();

View file

@ -6,7 +6,6 @@ import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePlayerOrPlaneswalker;
import mage.filter.common.FilterPermanentOrPlayer;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
* @author BetaSteward_at_googlemail.com
@ -17,7 +16,7 @@ public class TargetAnyTargetAmount extends TargetPermanentOrPlayerAmount {
= new FilterCreaturePlayerOrPlaneswalker("targets");
static {
defaultFilter.getPermanentFilter().add(new CardTypePredicate(CardType.CREATURE));
defaultFilter.getPermanentFilter().add(CardType.CREATURE.getPredicate());
}
public TargetAnyTargetAmount(int amount) {

View file

@ -5,7 +5,6 @@ package mage.target.common;
import mage.constants.CardType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.TargetCard;
@ -18,7 +17,7 @@ public class TargetBasicLandCard extends TargetCard {
public TargetBasicLandCard(Zone zone) {
super(zone);
filter.add(new SupertypePredicate(SuperType.BASIC));
filter.add(new CardTypePredicate(CardType.LAND));
filter.add(CardType.LAND.getPredicate());
}
public TargetBasicLandCard(final TargetBasicLandCard target) {

View file

@ -5,7 +5,6 @@ import mage.abilities.dynamicvalue.common.StaticValue;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterPermanentOrPlayer;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
* @author BetaSteward_at_googlemail.com
@ -16,7 +15,7 @@ public class TargetCreatureOrPlayerAmount extends TargetPermanentOrPlayerAmount
= new FilterPermanentOrPlayer("creatures and/or players");
static {
defaultFilter.getPermanentFilter().add(new CardTypePredicate(CardType.CREATURE));
defaultFilter.getPermanentFilter().add(CardType.CREATURE.getPredicate());
}
public TargetCreatureOrPlayerAmount(int amount) {