[refactoring] Fixed issues caused by notCardType.

Removed notCardType - it was a relic from previous implementation.
Renamed notScopeCardType to scopeNotCardType.
Renamed notCardTypeList to notCardType for consistency with cardType.
This commit is contained in:
North 2012-07-03 08:57:14 +03:00
parent ed877f772b
commit 4639abd279
13 changed files with 23 additions and 45 deletions

View file

@ -58,7 +58,7 @@ public class DualCasting extends CardImpl<DualCasting> {
static {
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.SORCERY);
filter.setNotScopeCardType(Filter.ComparisonScope.Any);
filter.setScopeCardType(Filter.ComparisonScope.Any);
}
public DualCasting(UUID ownerId) {

View file

@ -47,7 +47,7 @@ public class PeerThroughDepths extends CardImpl<PeerThroughDepths> {
static {
filter.getCardType().add(CardType.SORCERY);
filter.getCardType().add(CardType.INSTANT);
filter.setNotScopeCardType(ComparisonScope.Any);
filter.setScopeCardType(ComparisonScope.Any);
}

View file

@ -46,7 +46,6 @@ public class Countersquall extends CardImpl<Countersquall> {
static {
filter.getNotCardType().add(CardType.CREATURE);
filter.setNotCardType(true);
}
public Countersquall(UUID ownerId) {

View file

@ -56,7 +56,6 @@ public class NicolBolasPlaneswalker extends CardImpl<NicolBolasPlaneswalker> {
static {
filter.getNotCardType().add(CardType.CREATURE);
filter.setNotCardType(true);
}
public NicolBolasPlaneswalker(UUID ownerId) {

View file

@ -38,8 +38,8 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterNonlandPermanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -49,13 +49,7 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class BanishingKnack extends CardImpl<BanishingKnack> {
private final static FilterPermanent filter = new FilterPermanent("nonland permanent");
static {
filter.getCardType().add(CardType.LAND);
filter.setNotCardType(true);
filter.setScopeCardType(Filter.ComparisonScope.Any);
}
private final static FilterPermanent filter = new FilterNonlandPermanent();
public BanishingKnack(UUID ownerId) {
super(ownerId, 17, "Banishing Knack", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}");

View file

@ -45,7 +45,6 @@ public class Bramblecrush extends CardImpl<Bramblecrush> {
static {
filter.getNotCardType().add(CardType.CREATURE);
filter.setNotCardType(true);
}
public Bramblecrush(UUID ownerId) {

View file

@ -35,8 +35,8 @@ import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterNonlandPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -50,8 +50,9 @@ public class PlanarCleansing extends CardImpl<PlanarCleansing> {
super(ownerId, 24, "Planar Cleansing", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{W}{W}{W}");
this.expansionSetCode = "M10";
this.color.setWhite(true);
this.getSpellAbility().addEffect(new PlanarCleansingEffect());
// Destroy all nonland permanents.
this.getSpellAbility().addEffect(new PlanarCleansingEffect());
}
public PlanarCleansing(final PlanarCleansing card) {
@ -66,13 +67,7 @@ public class PlanarCleansing extends CardImpl<PlanarCleansing> {
class PlanarCleansingEffect extends OneShotEffect<PlanarCleansingEffect> {
private final static FilterPermanent filter = new FilterPermanent("");
static {
filter.getCardType().add(CardType.LAND);
filter.setNotCardType(true);
filter.setScopeCardType(Filter.ComparisonScope.Any);
}
private final static FilterPermanent filter = new FilterNonlandPermanent();
public PlanarCleansingEffect() {
super(Constants.Outcome.DestroyPermanent);

View file

@ -47,7 +47,7 @@ public class MuddleTheMixture extends CardImpl<MuddleTheMixture> {
static {
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.SORCERY);
filter.setNotScopeCardType(Filter.ComparisonScope.Any);
filter.setScopeCardType(Filter.ComparisonScope.Any);
}
public MuddleTheMixture(UUID ownerId) {

View file

@ -51,8 +51,7 @@ public class Magmaw extends CardImpl<Magmaw> {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("nonland permanent");
static {
filter.getCardType().add(CardType.LAND);
filter.setNotCardType(true);
filter.getNotCardType().add(CardType.LAND);
}
public Magmaw(UUID ownerId) {

View file

@ -52,7 +52,7 @@ public class Cursecatcher extends CardImpl<Cursecatcher> {
static {
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.SORCERY);
filter.setNotScopeCardType(ComparisonScope.Any);
filter.setScopeCardType(ComparisonScope.Any);
}
public Cursecatcher(UUID ownerId) {

View file

@ -49,9 +49,8 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
protected boolean notAbilities;
protected List<CardType> cardType = new ArrayList<CardType>();
protected ComparisonScope scopeCardType = ComparisonScope.Any;
protected List<CardType> notCardTypeList = new ArrayList<CardType>();
protected ComparisonScope notScopeCardType = ComparisonScope.Any;
protected boolean notCardType;
protected List<CardType> notCardType = new ArrayList<CardType>();
protected ComparisonScope scopeNotCardType = ComparisonScope.Any;
protected boolean colorless;
protected boolean useColorless;
protected boolean useColor;
@ -94,10 +93,9 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
this.abilities = filter.abilities.copy();
this.notAbilities = filter.notAbilities;
this.cardType.addAll(filter.cardType);
this.notCardTypeList.addAll(filter.notCardTypeList);
this.notCardType.addAll(filter.notCardType);
this.scopeCardType = filter.scopeCardType;
this.notCardType = filter.notCardType;
this.notScopeCardType = filter.notScopeCardType;
this.scopeNotCardType = filter.scopeNotCardType;
this.colorless = filter.colorless;
this.useColorless = filter.useColorless;
this.useColor = filter.useColor;
@ -151,12 +149,12 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
}
if (cardType.size() > 0) {
if (!compCardType.compare(cardType, object.getCardType(), scopeCardType, notCardType))
if (!compCardType.compare(cardType, object.getCardType(), scopeCardType, false))
return notFilter;
}
if (notCardTypeList.size() > 0) {
if (compCardType.compare(notCardTypeList, object.getCardType(), notScopeCardType, false))
if (notCardType.size() > 0) {
if (compCardType.compare(notCardType, object.getCardType(), scopeNotCardType, false))
return notFilter;
}
@ -217,19 +215,15 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
}
public List<CardType> getNotCardType() {
return this.notCardTypeList;
return this.notCardType;
}
public void setScopeCardType(ComparisonScope scopeCardType) {
this.scopeCardType = scopeCardType;
}
public void setNotScopeCardType(ComparisonScope notScopeCardType) {
this.notScopeCardType = notScopeCardType;
}
public void setNotCardType(boolean notCardTypeList) {
this.notCardType = notCardTypeList;
public void setScopeNotCardType(ComparisonScope scopeNotCardType) {
this.scopeNotCardType = scopeNotCardType;
}
public void setColor(ObjectColor color) {

View file

@ -43,7 +43,7 @@ public class FilterNonlandCard extends FilterCard<FilterNonlandCard> {
public FilterNonlandCard(String name) {
super(name);
this.notCardTypeList.add(CardType.LAND);
this.notCardType.add(CardType.LAND);
}
public FilterNonlandCard(final FilterNonlandCard filter) {

View file

@ -43,8 +43,7 @@ public class FilterNonlandPermanent extends FilterPermanent<FilterNonlandPermane
public FilterNonlandPermanent(String name) {
super(name);
notCardType = true;
cardType.add(CardType.LAND);
notCardType.add(CardType.LAND);
}
public FilterNonlandPermanent(final FilterNonlandPermanent filter) {