refactored AnotherPredicate to singleton enum

This commit is contained in:
Evan Kranzler 2019-01-12 16:12:51 -05:00
parent 92b5535a0e
commit e6b99215e1
417 changed files with 427 additions and 427 deletions

View file

@ -30,7 +30,7 @@ public class DiesCreatureTriggeredAbility extends TriggeredAbilityImpl {
public DiesCreatureTriggeredAbility(Effect effect, boolean optional, boolean another, boolean setTargetPointer) {
this(effect, optional, new FilterCreaturePermanent(another ? "another creature" : "a creature"));
if (another) {
filter.add(new AnotherPredicate());
filter.add(AnotherPredicate.instance);
}
this.setTargetPointer = setTargetPointer;
}

View file

@ -41,7 +41,7 @@ public class DevourEffect extends ReplacementEffectImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creatures to devour");
static {
filter.add(new AnotherPredicate());
filter.add(AnotherPredicate.instance);
}
private final DevourFactor devourFactor;

View file

@ -99,7 +99,7 @@ public class ChampionAbility extends StaticAbility {
if (requiresCreature) {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
filter.add(new AnotherPredicate());
filter.add(AnotherPredicate.instance);
// When this permanent enters the battlefield, sacrifice it unless you exile another [object] you control.
Ability ability1 = new EntersBattlefieldTriggeredAbility(

View file

@ -112,7 +112,7 @@ class SoulboundEntersSelfEffect extends OneShotEffect {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another not paired creature you control");
static {
filter.add(new AnotherPredicate());
filter.add(AnotherPredicate.instance);
filter.add(Predicates.not(new PairedPredicate()));
}
@ -173,7 +173,7 @@ class SoulbondEntersOtherAbility extends EntersBattlefieldAllTriggeredAbility {
static {
soulbondFilter.add(Predicates.not(new PairedPredicate()));
soulbondFilter.add(new ControllerPredicate(TargetController.YOU));
soulbondFilter.add(new AnotherPredicate());
soulbondFilter.add(AnotherPredicate.instance);
}
public SoulbondEntersOtherAbility() {
@ -214,7 +214,7 @@ class SoulboundEntersOtherEffect extends OneShotEffect {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another not paired creature you control");
static {
filter.add(new AnotherPredicate());
filter.add(AnotherPredicate.instance);
filter.add(Predicates.not(new PairedPredicate()));
}

View file

@ -24,7 +24,7 @@ public class SupportAbility extends EntersBattlefieldTriggeredAbility {
if (!card.isInstant() && !card.isSorcery()) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures");
if (card.isCreature()) {
filter.add(new AnotherPredicate());
filter.add(AnotherPredicate.instance);
filter.setMessage("other target creatures");
}
addTarget(new TargetCreaturePermanent(0, amount, filter, false));

View file

@ -297,7 +297,7 @@ public final class StaticFilters {
public static final FilterControlledCreaturePermanent FILTER_CONTROLLED_ANOTHER_CREATURE = new FilterControlledCreaturePermanent("another creature");
static {
FILTER_CONTROLLED_ANOTHER_CREATURE.add(new AnotherPredicate());
FILTER_CONTROLLED_ANOTHER_CREATURE.add(AnotherPredicate.instance);
FILTER_CONTROLLED_ANOTHER_CREATURE.setLockedFilter(true);
}

View file

@ -7,10 +7,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author North
*/
public class AnotherPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Permanent>> {
public enum AnotherPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Permanent>> {
instance;
@Override
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {

View file

@ -72,7 +72,7 @@ class BelzenlokDemonTokenEffect extends OneShotEffect {
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(new AnotherPredicate());
filter.add(AnotherPredicate.instance);
}
BelzenlokDemonTokenEffect() {