From ead577341183f2f1c503571d5bbec7fc130b9144 Mon Sep 17 00:00:00 2001 From: North Date: Sat, 14 Jul 2012 15:54:53 +0300 Subject: [PATCH] [filters] Removed unused code from Filters --- Mage/src/mage/filter/FilterPermanent.java | 51 ------------------- .../filter/common/FilterCreatureOrPlayer.java | 8 --- .../common/FilterPermanentOrPlayer.java | 8 --- .../FilterPermanentOrPlayerWithCounter.java | 4 -- .../filter/common/FilterSpellOrPermanent.java | 8 --- 5 files changed, 79 deletions(-) diff --git a/Mage/src/mage/filter/FilterPermanent.java b/Mage/src/mage/filter/FilterPermanent.java index a0672f3a1be..f878d050833 100644 --- a/Mage/src/mage/filter/FilterPermanent.java +++ b/Mage/src/mage/filter/FilterPermanent.java @@ -41,14 +41,8 @@ import java.util.UUID; * @author BetaSteward_at_googlemail.com */ public class FilterPermanent extends FilterObject { - protected List ownerId = new ArrayList(); - protected boolean notOwner; protected List controllerId = new ArrayList(); protected boolean notController; - protected boolean useFlipped; - protected boolean flipped; - protected boolean useFaceup; - protected boolean faceup; protected TargetController controller = TargetController.ANY; protected TargetController owner = TargetController.ANY; protected boolean another; @@ -59,14 +53,8 @@ public class FilterPermanent extends FilterObject { public FilterPermanent(final FilterPermanent filter) { super(filter); - this.ownerId = new ArrayList(filter.ownerId); - this.notOwner = filter.notOwner; this.controllerId = new ArrayList(filter.controllerId); this.notController = filter.notController; - this.useFlipped = filter.useFlipped; - this.flipped = filter.flipped; - this.useFaceup = filter.useFaceup; - this.faceup = filter.faceup; this.controller = filter.controller; this.owner = filter.owner; this.another = filter.another; @@ -81,18 +69,9 @@ public class FilterPermanent extends FilterObject { if (!super.match(permanent, game)) return notFilter; - if (ownerId.size() > 0 && ownerId.contains(permanent.getOwnerId()) == notOwner) - return notFilter; - if (controllerId.size() > 0 && controllerId.contains(permanent.getControllerId()) == notController) return notFilter; - if (useFlipped && permanent.isFlipped() != flipped) - return notFilter; - - if (useFaceup && permanent.isFaceUp() != faceup) - return notFilter; - return !notFilter; } @@ -144,14 +123,6 @@ public class FilterPermanent extends FilterObject { return !notFilter; } - public List getOwnerId() { - return ownerId; - } - - public void setNotOwner(boolean notOwner) { - this.notOwner = notOwner; - } - public List getControllerId() { return controllerId; } @@ -160,22 +131,6 @@ public class FilterPermanent extends FilterObject { this.notController = notController; } - public void setUseFlipped(boolean useFlipped) { - this.useFlipped = useFlipped; - } - - public void setFlipped(boolean flipped) { - this.flipped = flipped; - } - - public void setUseFaceup(boolean useFaceup) { - this.useFaceup = useFaceup; - } - - public void setFaceup(boolean faceup) { - this.faceup = faceup; - } - public void setTargetController(TargetController controller) { this.controller = controller; } @@ -192,12 +147,6 @@ public class FilterPermanent extends FilterObject { this.another = another; } - public boolean matchOwner(UUID testOwnerId) { - if (ownerId.size() > 0 && ownerId.contains(testOwnerId) == notOwner) - return false; - return true; - } - public boolean matchController(UUID testControllerId) { if (controllerId.size() > 0 && controllerId.contains(testControllerId) == notController) return false; diff --git a/Mage/src/mage/filter/common/FilterCreatureOrPlayer.java b/Mage/src/mage/filter/common/FilterCreatureOrPlayer.java index 79b677bb0cb..8f1f104e18f 100644 --- a/Mage/src/mage/filter/common/FilterCreatureOrPlayer.java +++ b/Mage/src/mage/filter/common/FilterCreatureOrPlayer.java @@ -50,14 +50,6 @@ public class FilterCreatureOrPlayer extends FilterImpl implements Filter this("player or creature"); } - public FilterCreatureOrPlayer(String name, UUID controllerId) { - super(name); - creatureFilter = new FilterCreaturePermanent(); - playerFilter = new FilterPlayer(); - creatureFilter.getControllerId().add(controllerId); - playerFilter.getPlayerId().add(controllerId); - } - public FilterCreatureOrPlayer(String name) { super(name); creatureFilter = new FilterCreaturePermanent(); diff --git a/Mage/src/mage/filter/common/FilterPermanentOrPlayer.java b/Mage/src/mage/filter/common/FilterPermanentOrPlayer.java index 90b8ee95943..4ea48cbc8f8 100644 --- a/Mage/src/mage/filter/common/FilterPermanentOrPlayer.java +++ b/Mage/src/mage/filter/common/FilterPermanentOrPlayer.java @@ -50,14 +50,6 @@ public class FilterPermanentOrPlayer extends FilterImpl implements Filte this("player or permanent"); } - public FilterPermanentOrPlayer(String name, UUID controllerId) { - super(name); - permanentFilter = new FilterPermanent(); - playerFilter = new FilterPlayer(); - permanentFilter.getControllerId().add(controllerId); - playerFilter.getPlayerId().add(controllerId); - } - public FilterPermanentOrPlayer(String name) { super(name); permanentFilter = new FilterPermanent(); diff --git a/Mage/src/mage/filter/common/FilterPermanentOrPlayerWithCounter.java b/Mage/src/mage/filter/common/FilterPermanentOrPlayerWithCounter.java index 45805891b08..3e253793eb1 100644 --- a/Mage/src/mage/filter/common/FilterPermanentOrPlayerWithCounter.java +++ b/Mage/src/mage/filter/common/FilterPermanentOrPlayerWithCounter.java @@ -43,10 +43,6 @@ public class FilterPermanentOrPlayerWithCounter extends FilterPermanentOrPlayer this("player or permanent with counters on them"); } - public FilterPermanentOrPlayerWithCounter(String name, UUID controllerId) { - super(name, controllerId); - } - public FilterPermanentOrPlayerWithCounter(String name) { super(name); } diff --git a/Mage/src/mage/filter/common/FilterSpellOrPermanent.java b/Mage/src/mage/filter/common/FilterSpellOrPermanent.java index 0cb6e240531..dc1aa9e44b6 100644 --- a/Mage/src/mage/filter/common/FilterSpellOrPermanent.java +++ b/Mage/src/mage/filter/common/FilterSpellOrPermanent.java @@ -52,14 +52,6 @@ public class FilterSpellOrPermanent extends FilterImpl implements Filter this("spell or permanent"); } - public FilterSpellOrPermanent(String name, UUID controllerId) { - super(name); - permanentFilter = new FilterPermanent(); - spellFilter = new FilterSpell(); - permanentFilter.getControllerId().add(controllerId); - spellFilter.getControllerId().add(controllerId); - } - public FilterSpellOrPermanent(String name) { super(name); permanentFilter = new FilterPermanent();