From 9f98b07d617d7d6831f280dbd916e41189f99e64 Mon Sep 17 00:00:00 2001
From: jendave
Date: Tue, 15 Nov 2011 19:34:53 +0000
Subject: [PATCH] Fixed a lot of Checkstyle stuff. Removed some checks -
method, class and line length
---
pom.xml | 2 +-
src/main/config/forge_checks.xml | 6 +-
src/main/java/forge/Card.java | 2108 +++++++++--------
src/main/java/forge/CardReader.java | 141 +-
src/main/java/forge/CardUtil.java | 187 +-
src/main/java/forge/Combat.java | 8 +-
src/main/java/forge/CombatUtil.java | 640 ++---
src/main/java/forge/ComputerAIGeneral.java | 150 +-
src/main/java/forge/ComputerUtil.java | 383 +--
src/main/java/forge/ComputerUtilAttack.java | 240 +-
src/main/java/forge/Counters.java | 2 +-
src/main/java/forge/GameAction.java | 192 +-
.../java/forge/GuiDownloadPicturesLQ.java | 2 +-
.../java/forge/GuiDownloadSetPicturesLQ.java | 71 +-
src/main/java/forge/Upkeep.java | 20 +-
.../java/forge/card/BoosterGenerator.java | 33 +-
src/main/java/forge/card/CardRules.java | 248 +-
src/main/java/forge/card/CardRulesReader.java | 2 +-
src/main/java/forge/card/MtgDataParser.java | 2 +-
.../abilityfactory/AbilityFactoryChoose.java | 2 +-
.../AbilityFactoryDealDamage.java | 115 +-
.../abilityfactory/AbilityFactoryDestroy.java | 6 +-
.../AbilityFactoryGainControl.java | 2 +-
.../abilityfactory/AbilityFactoryPump.java | 52 +-
.../abilityfactory/AbilityFactoryReveal.java | 8 +-
.../AbilityFactorySetState.java | 61 +-
.../AbilityFactoryZoneAffecting.java | 9 +-
.../card/cardfactory/AbstractCardFactory.java | 103 +-
.../cardfactory/CardFactoryCreatures.java | 140 +-
.../card/cardfactory/CardFactoryUtil.java | 197 +-
src/main/java/forge/card/cost/CostMana.java | 39 +-
.../card/spellability/AbilityActivated.java | 1 -
.../forge/card/spellability/SpellAbility.java | 68 +-
.../spellability/SpellAbilityRestriction.java | 2 +-
.../java/forge/card/spellability/Target.java | 7 +-
.../card/staticability/StaticAbility.java | 36 +-
.../StaticAbilityCantBeCast.java | 20 +-
.../StaticAbilityCantTarget.java | 31 +-
.../forge/card/trigger/TriggerHandler.java | 2 +-
.../deck/generate/Generate2ColorDeck.java | 16 +-
.../deck/generate/Generate3ColorDeck.java | 16 +-
.../deck/generate/Generate5ColorDeck.java | 14 +-
.../deck/generate/GenerateThemeDeck.java | 8 +-
.../forge/gui/deckeditor/CardPanelHeavy.java | 47 +-
.../forge/gui/deckeditor/CardPanelLite.java | 10 +-
.../gui/deckeditor/DeckEditorCommon.java | 15 +-
.../forge/gui/deckeditor/DeckEditorShop.java | 28 +-
.../forge/gui/input/InputPayManaCost.java | 47 +-
src/main/java/forge/gui/skin/FPanel.java | 36 +-
src/main/java/forge/gui/skin/FSkin.java | 8 +-
src/main/java/forge/item/CardPrinted.java | 4 -
.../forge/properties/ForgePreferences.java | 259 +-
.../java/forge/properties/NewConstants.java | 3 +-
src/main/java/forge/quest/data/QuestData.java | 2 +-
.../forge/quest/gui/QuestWinLoseHandler.java | 2 +-
.../java/forge/view/swing/OldGuiNewGame.java | 129 +-
.../java/forge/view/swing/WinLoseFrame.java | 46 +-
57 files changed, 3171 insertions(+), 2857 deletions(-)
diff --git a/pom.xml b/pom.xml
index 8e113672479..8ea94976d96 100644
--- a/pom.xml
+++ b/pom.xml
@@ -469,7 +469,7 @@
org.apache.maven.plugins
maven-pmd-plugin
- 2.5
+ 2.6
true
utf-8
diff --git a/src/main/config/forge_checks.xml b/src/main/config/forge_checks.xml
index 067a4f586fb..f299dac2d1e 100644
--- a/src/main/config/forge_checks.xml
+++ b/src/main/config/forge_checks.xml
@@ -53,7 +53,7 @@
-
+
@@ -131,11 +131,11 @@
-
+
diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java
index 7fe53d882d8..8d1e3dfdbce 100644
--- a/src/main/java/forge/Card.java
+++ b/src/main/java/forge/Card.java
@@ -40,100 +40,147 @@ import forge.item.CardDb;
*/
public class Card extends GameEntity implements Comparable {
private static int nextUniqueNumber = 1;
- private int uniqueNumber = nextUniqueNumber++;
+ private int uniqueNumber = Card.nextUniqueNumber++;
private long value;
-
- private Map characteristicsMap = new HashMap();
+
+ private final Map characteristicsMap = new HashMap();
private String curCharacteristics = "Original";
private String preTFDCharacteristic = "Original";
private boolean isDoubleFaced = false;
private boolean isFlip = false;
-
+
+ /**
+ * Instantiates a new card.
+ */
public Card() {
- characteristicsMap.put("Original", new CardCharacteristics());
- characteristicsMap.put("FaceDown", CardUtil.getFaceDownCharacteristic());
+ this.characteristicsMap.put("Original", new CardCharacteristics());
+ this.characteristicsMap.put("FaceDown", CardUtil.getFaceDownCharacteristic());
}
-
- public boolean setState(String state) {
- if(state.equals("FaceDown") && isDoubleFaced) {
- return false; //Doublefaced cards can't be turned face-down.
+
+ /**
+ * Sets the state.
+ *
+ * @param state the state
+ * @return true, if successful
+ */
+ public boolean setState(final String state) {
+ if (state.equals("FaceDown") && this.isDoubleFaced) {
+ return false; // Doublefaced cards can't be turned face-down.
}
-
- if(!characteristicsMap.containsKey(state)) {
- System.out.println(getName() + " tried to switch to non-existant state \"" + state + "\"!");
- return false; //Nonexistant state.
+
+ if (!this.characteristicsMap.containsKey(state)) {
+ System.out.println(this.getName() + " tried to switch to non-existant state \"" + state + "\"!");
+ return false; // Nonexistant state.
}
-
- if(state.equals(curCharacteristics)) {
+
+ if (state.equals(this.curCharacteristics)) {
return false;
}
-
- curCharacteristics = state;
+
+ this.curCharacteristics = state;
return true;
}
-
+
+ /**
+ * Gets the states.
+ *
+ * @return the states
+ */
public Set getStates() {
- return characteristicsMap.keySet();
+ return this.characteristicsMap.keySet();
}
-
+
+ /**
+ * Gets the cur state.
+ *
+ * @return the cur state
+ */
public String getCurState() {
- return curCharacteristics;
+ return this.curCharacteristics;
}
-
- public void switchStates(String from,String to)
- {
- CardCharacteristics tmp = characteristicsMap.get(from);
- characteristicsMap.put(from, characteristicsMap.get(to));
- characteristicsMap.put(to, tmp);
+
+ /**
+ * Switch states.
+ *
+ * @param from the from
+ * @param to the to
+ */
+ public void switchStates(final String from, final String to) {
+ final CardCharacteristics tmp = this.characteristicsMap.get(from);
+ this.characteristicsMap.put(from, this.characteristicsMap.get(to));
+ this.characteristicsMap.put(to, tmp);
}
-
- public void clearStates(String state) {
- characteristicsMap.remove(state);
+
+ /**
+ * Clear states.
+ *
+ * @param state the state
+ */
+ public void clearStates(final String state) {
+ this.characteristicsMap.remove(state);
}
-
+
+ /**
+ * Turn face down.
+ */
public void turnFaceDown() {
- if(!isDoubleFaced) {
- preTFDCharacteristic = curCharacteristics;
- curCharacteristics = "FaceDown";
+ if (!this.isDoubleFaced) {
+ this.preTFDCharacteristic = this.curCharacteristics;
+ this.curCharacteristics = "FaceDown";
}
}
-
+
+ /**
+ * Turn face up.
+ */
public void turnFaceUp() {
- if(curCharacteristics.equals("FaceDown")) {
- curCharacteristics = preTFDCharacteristic;
+ if (this.curCharacteristics.equals("FaceDown")) {
+ this.curCharacteristics = this.preTFDCharacteristic;
}
}
-
+
+ /**
+ * Checks if is cloned.
+ *
+ * @return true, if is cloned
+ */
public boolean isCloned() {
- for(String state : characteristicsMap.keySet()) {
- if(state.equals("Cloner")) {
+ for (final String state : this.characteristicsMap.keySet()) {
+ if (state.equals("Cloner")) {
return true;
}
}
return false;
}
-
- public CardCharacteristics getState(String state) {
- return characteristicsMap.get(state);
+
+ /**
+ * Gets the state.
+ *
+ * @param state the state
+ * @return the state
+ */
+ public CardCharacteristics getState(final String state) {
+ return this.characteristicsMap.get(state);
}
-
+
/**
* Gets the characteristics.
*
* @return the characteristics
*/
public CardCharacteristics getCharacteristics() {
- return characteristicsMap.get(curCharacteristics);
+ return this.characteristicsMap.get(this.curCharacteristics);
}
/**
- *
* addAlternateState.
+ *
+ * @param state the state
*/
- public final void addAlternateState(String state) {
- characteristicsMap.put(state,new CardCharacteristics());
+ public final void addAlternateState(final String state) {
+ this.characteristicsMap.put(state, new CardCharacteristics());
}
/*
@@ -143,7 +190,7 @@ public class Card extends GameEntity implements Comparable {
*/
@Override
public final String getName() {
- return getCharacteristics().getName();
+ return this.getCharacteristics().getName();
}
/*
@@ -153,7 +200,7 @@ public class Card extends GameEntity implements Comparable {
*/
@Override
public final void setName(final String name0) {
- getCharacteristics().setName(name0);
+ this.getCharacteristics().setName(name0);
}
/**
@@ -163,7 +210,7 @@ public class Card extends GameEntity implements Comparable {
* @return boolean
*/
public final boolean isInAlternateState() {
- return !(curCharacteristics.equals("Original") || curCharacteristics.equals("Cloned"));
+ return !(this.curCharacteristics.equals("Original") || this.curCharacteristics.equals("Cloned"));
}
/**
@@ -173,7 +220,7 @@ public class Card extends GameEntity implements Comparable {
* @return boolean
*/
public final boolean hasAlternateState() {
- return characteristicsMap.keySet().size() > 2;
+ return this.characteristicsMap.keySet().size() > 2;
}
/**
@@ -182,7 +229,7 @@ public class Card extends GameEntity implements Comparable {
* @return the isDoubleFaced
*/
public final boolean isDoubleFaced() {
- return isDoubleFaced;
+ return this.isDoubleFaced;
}
/**
@@ -202,7 +249,7 @@ public class Card extends GameEntity implements Comparable {
* @return the isFlip
*/
public final boolean isFlip() {
- return isFlip;
+ return this.isFlip;
}
/**
@@ -217,12 +264,12 @@ public class Card extends GameEntity implements Comparable {
}
private Map counters = new TreeMap();
- private Map triggeringObjects = new TreeMap();
+ private final Map triggeringObjects = new TreeMap();
private ArrayList extrinsicKeyword = new ArrayList();
// Hidden keywords won't be displayed on the card
- private ArrayList hiddenExtrinsicKeyword = new ArrayList();
+ private final ArrayList hiddenExtrinsicKeyword = new ArrayList();
private ArrayList prevIntrinsicKeyword = new ArrayList();
- private ArrayList attachedByMindsDesire = new ArrayList();
+ private final ArrayList attachedByMindsDesire = new ArrayList();
// which equipment cards are equipping this card?
private ArrayList equippedBy = new ArrayList();
// equipping size will always be 0 or 1
@@ -234,21 +281,21 @@ public class Card extends GameEntity implements Comparable {
// if this card is an Aura, what Entity is it enchanting?
private GameEntity enchanting = null;
private ArrayList prevType = new ArrayList();
- private ArrayList choicesMade = new ArrayList();
- private ArrayList targetsForChoices = new ArrayList();
+ private final ArrayList choicesMade = new ArrayList();
+ private final ArrayList targetsForChoices = new ArrayList();
// changes by AF animate and continuous static effects
private ArrayList changedCardTypes = new ArrayList();
private ArrayList changedCardKeywords = new ArrayList();
- private ArrayList
*/
public final void clearRemembered() {
- rememberedObjects.clear();
+ this.rememberedObjects.clear();
}
/**
@@ -455,7 +502,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link forge.Card} object.
*/
public final void addImprinted(final Card c) {
- imprintedCards.add(c);
+ this.imprintedCards.add(c);
}
/**
@@ -467,7 +514,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link java.util.ArrayList} object.
*/
public final void addImprinted(final ArrayList list) {
- imprintedCards.addAll(list);
+ this.imprintedCards.addAll(list);
}
/**
@@ -478,7 +525,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getImprinted() {
- return imprintedCards;
+ return this.imprintedCards;
}
/**
@@ -487,7 +534,7 @@ public class Card extends GameEntity implements Comparable {
*
*/
public final void clearImprinted() {
- imprintedCards.clear();
+ this.imprintedCards.clear();
}
/**
@@ -500,7 +547,7 @@ public class Card extends GameEntity implements Comparable {
* @since 1.0.15
*/
public final void setChampionedCard(final Card c) {
- championedCard = c;
+ this.championedCard = c;
}
/**
@@ -512,7 +559,7 @@ public class Card extends GameEntity implements Comparable {
* @since 1.0.15
*/
public final Card getChampionedCard() {
- return championedCard;
+ return this.championedCard;
}
/**
@@ -525,9 +572,9 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link forge.card.trigger.Trigger} object.
*/
public final Trigger addTrigger(final Trigger t) {
- Trigger newtrig = t.getCopy();
+ final Trigger newtrig = t.getCopy();
newtrig.setHostCard(this);
- getCharacteristics().getTriggers().add(newtrig);
+ this.getCharacteristics().getTriggers().add(newtrig);
return newtrig;
}
@@ -540,8 +587,8 @@ public class Card extends GameEntity implements Comparable {
*/
public final void moveTrigger(final Trigger t) {
t.setHostCard(this);
- if (!getCharacteristics().getTriggers().contains(t)) {
- getCharacteristics().getTriggers().add(t);
+ if (!this.getCharacteristics().getTriggers().contains(t)) {
+ this.getCharacteristics().getTriggers().add(t);
}
}
@@ -554,7 +601,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link forge.card.trigger.Trigger} object.
*/
public final void removeTrigger(final Trigger t) {
- getCharacteristics().getTriggers().remove(t);
+ this.getCharacteristics().getTriggers().remove(t);
}
/**
@@ -565,7 +612,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getTriggers() {
- return getCharacteristics().getTriggers();
+ return this.getCharacteristics().getTriggers();
}
/**
@@ -578,8 +625,8 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link forge.card.trigger.Trigger} object.
*/
public final Trigger getNamedTrigger(final String name) {
- for (Trigger t : getCharacteristics().getTriggers()) {
- if (t.getName() != null && t.getName().equals(name)) {
+ for (final Trigger t : this.getCharacteristics().getTriggers()) {
+ if ((t.getName() != null) && t.getName().equals(name)) {
return t;
}
}
@@ -596,16 +643,16 @@ public class Card extends GameEntity implements Comparable {
* a {@link java.util.ArrayList} object.
*/
public final void setTriggers(final ArrayList trigs) {
- ArrayList copyList = new ArrayList();
- for (Trigger t : trigs) {
+ final ArrayList copyList = new ArrayList();
+ for (final Trigger t : trigs) {
if (t.getIsIntrinsic()) {
- Trigger newtrig = t.getCopy();
+ final Trigger newtrig = t.getCopy();
newtrig.setHostCard(this);
copyList.add(newtrig);
}
}
- getCharacteristics().setTriggers(copyList);
+ this.getCharacteristics().setTriggers(copyList);
}
/**
@@ -614,7 +661,7 @@ public class Card extends GameEntity implements Comparable {
*
*/
public final void clearTriggersNew() {
- getCharacteristics().getTriggers().clear();
+ this.getCharacteristics().getTriggers().clear();
}
/**
@@ -627,7 +674,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.lang.Object} object.
*/
public final Object getTriggeringObject(final String typeIn) {
- return triggeringObjects.get(typeIn);
+ return this.triggeringObjects.get(typeIn);
}
/**
@@ -637,7 +684,7 @@ public class Card extends GameEntity implements Comparable {
* a int.
*/
public final void setAbilityUsed(final int i) {
- abilityUsed = i;
+ this.abilityUsed = i;
}
/**
@@ -648,7 +695,7 @@ public class Card extends GameEntity implements Comparable {
* @return a int.
*/
public final int getAbilityUsed() {
- return abilityUsed;
+ return this.abilityUsed;
}
/**
@@ -659,7 +706,7 @@ public class Card extends GameEntity implements Comparable {
* @return a int.
*/
public final int getSunburstValue() {
- return sunburstValue;
+ return this.sunburstValue;
}
/**
@@ -671,7 +718,7 @@ public class Card extends GameEntity implements Comparable {
* a String
*/
public final void setColorsPaid(final String s) {
- colorsPaid = s;
+ this.colorsPaid = s;
}
/**
@@ -682,7 +729,7 @@ public class Card extends GameEntity implements Comparable {
* @return a String.
*/
public final String getColorsPaid() {
- return colorsPaid;
+ return this.colorsPaid;
}
/**
@@ -694,7 +741,7 @@ public class Card extends GameEntity implements Comparable {
* a int.
*/
public final void setSunburstValue(final int valueIn) {
- sunburstValue = valueIn;
+ this.sunburstValue = valueIn;
}
/**
@@ -706,7 +753,7 @@ public class Card extends GameEntity implements Comparable {
* a int.
*/
public final void addXManaCostPaid(final int n) {
- xManaCostPaid += n;
+ this.xManaCostPaid += n;
}
/**
@@ -718,7 +765,7 @@ public class Card extends GameEntity implements Comparable {
* a int.
*/
public final void setXManaCostPaid(final int n) {
- xManaCostPaid = n;
+ this.xManaCostPaid = n;
}
/**
@@ -729,7 +776,7 @@ public class Card extends GameEntity implements Comparable {
* @return a int.
*/
public final int getXManaCostPaid() {
- return xManaCostPaid;
+ return this.xManaCostPaid;
}
/**
@@ -741,7 +788,7 @@ public class Card extends GameEntity implements Comparable {
* a int.
*/
public final void setXLifePaid(final int n) {
- xLifePaid = n;
+ this.xLifePaid = n;
}
/**
@@ -752,7 +799,7 @@ public class Card extends GameEntity implements Comparable {
* @return a int.
*/
public final int getXLifePaid() {
- return xLifePaid;
+ return this.xLifePaid;
}
// used to see if an attacking creature with a triggering attack ability
@@ -766,9 +813,9 @@ public class Card extends GameEntity implements Comparable {
* a boolean.
*/
public final void setCreatureAttackedThisCombat(final boolean b) {
- creatureAttackedThisCombat = b;
+ this.creatureAttackedThisCombat = b;
if (b) {
- setCreatureAttackedThisTurn(true);
+ this.setCreatureAttackedThisTurn(true);
}
}
@@ -780,7 +827,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean getCreatureAttackedThisCombat() {
- return creatureAttackedThisCombat;
+ return this.creatureAttackedThisCombat;
}
/**
@@ -792,7 +839,7 @@ public class Card extends GameEntity implements Comparable {
* a boolean.
*/
public final void setCreatureAttackedThisTurn(final boolean b) {
- creatureAttackedThisTurn = b;
+ this.creatureAttackedThisTurn = b;
}
/**
@@ -803,7 +850,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean getCreatureAttackedThisTurn() {
- return creatureAttackedThisTurn;
+ return this.creatureAttackedThisTurn;
}
/**
@@ -815,7 +862,7 @@ public class Card extends GameEntity implements Comparable {
* a boolean.
*/
public final void setCreatureBlockedThisCombat(final boolean b) {
- creatureBlockedThisCombat = b;
+ this.creatureBlockedThisCombat = b;
}
/**
@@ -826,7 +873,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean getCreatureBlockedThisCombat() {
- return creatureBlockedThisCombat;
+ return this.creatureBlockedThisCombat;
}
/**
@@ -838,7 +885,7 @@ public class Card extends GameEntity implements Comparable {
* a boolean.
*/
public final void setCreatureGotBlockedThisCombat(final boolean b) {
- creatureGotBlockedThisCombat = b;
+ this.creatureGotBlockedThisCombat = b;
}
/**
@@ -849,7 +896,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean getCreatureGotBlockedThisCombat() {
- return creatureGotBlockedThisCombat;
+ return this.creatureGotBlockedThisCombat;
}
/**
@@ -860,7 +907,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean canAnyPlayerActivate() {
- for (SpellAbility s : getCharacteristics().getSpellAbility()) {
+ for (final SpellAbility s : this.getCharacteristics().getSpellAbility()) {
if (s.getRestrictions().isAnyPlayer()) {
return true;
}
@@ -877,7 +924,7 @@ public class Card extends GameEntity implements Comparable {
* a boolean.
*/
public final void setDealtDmgToHumanThisTurn(final boolean b) {
- dealtDmgToHumanThisTurn = b;
+ this.dealtDmgToHumanThisTurn = b;
}
/**
@@ -888,7 +935,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean getDealtDmgToHumanThisTurn() {
- return dealtDmgToHumanThisTurn;
+ return this.dealtDmgToHumanThisTurn;
}
/**
@@ -900,7 +947,7 @@ public class Card extends GameEntity implements Comparable {
* a boolean.
*/
public final void setDealtDmgToComputerThisTurn(final boolean b) {
- dealtDmgToComputerThisTurn = b;
+ this.dealtDmgToComputerThisTurn = b;
}
/**
@@ -911,7 +958,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean getDealtDmgToComputerThisTurn() {
- return dealtDmgToComputerThisTurn;
+ return this.dealtDmgToComputerThisTurn;
}
/**
@@ -923,7 +970,7 @@ public class Card extends GameEntity implements Comparable {
* a boolean.
*/
public final void setSirenAttackOrDestroy(final boolean b) {
- sirenAttackOrDestroy = b;
+ this.sirenAttackOrDestroy = b;
}
/**
@@ -934,7 +981,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean getSirenAttackOrDestroy() {
- return sirenAttackOrDestroy;
+ return this.sirenAttackOrDestroy;
}
/**
@@ -947,7 +994,7 @@ public class Card extends GameEntity implements Comparable {
* @since 1.1.6
*/
public final void addMustBlockCard(final Card c) {
- mustBlockCards.add(c);
+ this.mustBlockCards.add(c);
}
/**
@@ -958,7 +1005,7 @@ public class Card extends GameEntity implements Comparable {
* @since 1.1.6
*/
public final ArrayList getMustBlockCards() {
- return mustBlockCards;
+ return this.mustBlockCards;
}
/**
@@ -967,7 +1014,7 @@ public class Card extends GameEntity implements Comparable {
* @since 1.1.6
*/
public final void clearMustBlockCards() {
- mustBlockCards.clear();
+ this.mustBlockCards.clear();
}
/**
@@ -978,7 +1025,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getClones() {
- return clones;
+ return this.clones;
}
/**
@@ -990,8 +1037,8 @@ public class Card extends GameEntity implements Comparable {
* a {@link java.util.ArrayList} object.
*/
public final void setClones(final ArrayList c) {
- clones.clear();
- clones.addAll(c);
+ this.clones.clear();
+ this.clones.addAll(c);
}
/**
@@ -1003,7 +1050,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link forge.Card} object.
*/
public final void addClone(final Card c) {
- clones.add(c);
+ this.clones.add(c);
}
/**
@@ -1015,7 +1062,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link java.util.ArrayList} object.
*/
public final void addClones(final ArrayList c) {
- clones.addAll(c);
+ this.clones.addAll(c);
}
/**
@@ -1024,7 +1071,7 @@ public class Card extends GameEntity implements Comparable {
*
*/
public final void clearClones() {
- clones.clear();
+ this.clones.clear();
}
/**
@@ -1035,7 +1082,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link forge.Card} object.
*/
public final Card getCloneOrigin() {
- return cloneOrigin;
+ return this.cloneOrigin;
}
/**
@@ -1047,7 +1094,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link forge.Card} object.
*/
public final void setCloneOrigin(final Card name) {
- cloneOrigin = name;
+ this.cloneOrigin = name;
}
/**
@@ -1058,7 +1105,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean getSacrificeAtEOT() {
- return hasKeyword("At the beginning of the end step, sacrifice CARDNAME.");
+ return this.hasKeyword("At the beginning of the end step, sacrifice CARDNAME.");
}
/**
@@ -1069,7 +1116,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean getBounceAtUntap() {
- return bounceAtUntap;
+ return this.bounceAtUntap;
}
/**
@@ -1092,7 +1139,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean getFinishedEnteringBF() {
- return finishedEnteringBF;
+ return this.finishedEnteringBF;
}
/**
@@ -1115,7 +1162,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean hasFirstStrike() {
- return hasKeyword("First Strike");
+ return this.hasKeyword("First Strike");
}
/**
@@ -1126,7 +1173,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean hasDoubleStrike() {
- return hasKeyword("Double Strike");
+ return this.hasKeyword("Double Strike");
}
/**
@@ -1137,7 +1184,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean hasSecondStrike() {
- return hasDoubleStrike() || !hasFirstStrike();
+ return this.hasDoubleStrike() || !this.hasFirstStrike();
}
// for costs (like Planeswalker abilities) Doubling Season gets ignored.
@@ -1158,11 +1205,11 @@ public class Card extends GameEntity implements Comparable {
if (this.hasKeyword("CARDNAME can't have -1/-1 counters placed on it.") && counterName.equals(Counters.M1M1)) {
return;
}
- if (counters.containsKey(counterName)) {
- Integer aux = counters.get(counterName) + n;
- counters.put(counterName, aux);
+ if (this.counters.containsKey(counterName)) {
+ final Integer aux = this.counters.get(counterName) + n;
+ this.counters.put(counterName, aux);
} else {
- counters.put(counterName, Integer.valueOf(n));
+ this.counters.put(counterName, Integer.valueOf(n));
}
if (counterName.equals(Counters.P1P1) || counterName.equals(Counters.M1M1)) {
@@ -1170,25 +1217,25 @@ public class Card extends GameEntity implements Comparable {
int plusOneCounters = 0;
int minusOneCounters = 0;
- Counters p1Counter = Counters.P1P1;
- Counters m1Counter = Counters.M1M1;
- if (counters.containsKey(p1Counter)) {
- plusOneCounters = counters.get(p1Counter);
+ final Counters p1Counter = Counters.P1P1;
+ final Counters m1Counter = Counters.M1M1;
+ if (this.counters.containsKey(p1Counter)) {
+ plusOneCounters = this.counters.get(p1Counter);
}
- if (counters.containsKey(m1Counter)) {
- minusOneCounters = counters.get(m1Counter);
+ if (this.counters.containsKey(m1Counter)) {
+ minusOneCounters = this.counters.get(m1Counter);
}
if (plusOneCounters == minusOneCounters) {
- counters.remove(m1Counter);
- counters.remove(p1Counter);
+ this.counters.remove(m1Counter);
+ this.counters.remove(p1Counter);
}
if (plusOneCounters > minusOneCounters) {
- counters.remove(m1Counter);
- counters.put(p1Counter, (Integer) (plusOneCounters - minusOneCounters));
+ this.counters.remove(m1Counter);
+ this.counters.put(p1Counter, (plusOneCounters - minusOneCounters));
} else {
- counters.put(m1Counter, (Integer) (minusOneCounters - plusOneCounters));
- counters.remove(p1Counter);
+ this.counters.put(m1Counter, (minusOneCounters - plusOneCounters));
+ this.counters.remove(p1Counter);
}
}
@@ -1224,16 +1271,16 @@ public class Card extends GameEntity implements Comparable {
if (this.hasKeyword("CARDNAME can't have -1/-1 counters placed on it.") && counterName.equals(Counters.M1M1)) {
return;
}
- int multiplier = AllZoneUtil.getDoublingSeasonMagnitude(this.getController());
- if (counters.containsKey(counterName)) {
- Integer aux = counters.get(counterName) + (multiplier * n);
- counters.put(counterName, aux);
+ final int multiplier = AllZoneUtil.getDoublingSeasonMagnitude(this.getController());
+ if (this.counters.containsKey(counterName)) {
+ final Integer aux = this.counters.get(counterName) + (multiplier * n);
+ this.counters.put(counterName, aux);
} else {
- counters.put(counterName, Integer.valueOf(multiplier * n));
+ this.counters.put(counterName, Integer.valueOf(multiplier * n));
}
// Run triggers
- Map runParams = new TreeMap();
+ final Map runParams = new TreeMap();
runParams.put("Card", this);
runParams.put("CounterType", counterName);
for (int i = 0; i < (multiplier * n); i++) {
@@ -1245,25 +1292,25 @@ public class Card extends GameEntity implements Comparable {
int plusOneCounters = 0;
int minusOneCounters = 0;
- Counters p1Counter = Counters.P1P1;
- Counters m1Counter = Counters.M1M1;
- if (counters.containsKey(p1Counter)) {
- plusOneCounters = counters.get(p1Counter);
+ final Counters p1Counter = Counters.P1P1;
+ final Counters m1Counter = Counters.M1M1;
+ if (this.counters.containsKey(p1Counter)) {
+ plusOneCounters = this.counters.get(p1Counter);
}
- if (counters.containsKey(m1Counter)) {
- minusOneCounters = counters.get(m1Counter);
+ if (this.counters.containsKey(m1Counter)) {
+ minusOneCounters = this.counters.get(m1Counter);
}
if (plusOneCounters == minusOneCounters) {
- counters.remove(m1Counter);
- counters.remove(p1Counter);
+ this.counters.remove(m1Counter);
+ this.counters.remove(p1Counter);
}
if (plusOneCounters > minusOneCounters) {
- counters.remove(m1Counter);
- counters.put(p1Counter, (Integer) (plusOneCounters - minusOneCounters));
+ this.counters.remove(m1Counter);
+ this.counters.put(p1Counter, (plusOneCounters - minusOneCounters));
} else {
- counters.put(m1Counter, (Integer) (minusOneCounters - plusOneCounters));
- counters.remove(p1Counter);
+ this.counters.put(m1Counter, (minusOneCounters - plusOneCounters));
+ this.counters.remove(p1Counter);
}
}
@@ -1283,20 +1330,20 @@ public class Card extends GameEntity implements Comparable {
* a int.
*/
public final void subtractCounter(final Counters counterName, final int n) {
- if (counters.containsKey(counterName)) {
- Integer aux = counters.get(counterName) - n;
+ if (this.counters.containsKey(counterName)) {
+ Integer aux = this.counters.get(counterName) - n;
if (aux < 0) {
aux = 0;
}
- counters.put(counterName, aux);
- if (counterName.equals(Counters.TIME) && aux == 0) {
- boolean hasVanish = CardFactoryUtil.hasKeyword(this, "Vanishing") != -1;
+ this.counters.put(counterName, aux);
+ if (counterName.equals(Counters.TIME) && (aux == 0)) {
+ final boolean hasVanish = CardFactoryUtil.hasKeyword(this, "Vanishing") != -1;
if (hasVanish && AllZoneUtil.isCardInPlay(this)) {
AllZone.getGameAction().sacrifice(this);
}
- if (hasSuspend() && AllZoneUtil.isCardExiled(this)) {
+ if (this.hasSuspend() && AllZoneUtil.isCardExiled(this)) {
final Card c = this;
c.setSuspendCast(true);
@@ -1324,8 +1371,8 @@ public class Card extends GameEntity implements Comparable {
* @return a int.
*/
public final int getCounters(final Counters counterName) {
- if (counters.containsKey(counterName)) {
- return counters.get(counterName);
+ if (this.counters.containsKey(counterName)) {
+ return this.counters.get(counterName);
} else {
return 0;
}
@@ -1341,7 +1388,7 @@ public class Card extends GameEntity implements Comparable {
* @since 1.0.15
*/
public final Map getCounters() {
- return counters;
+ return this.counters;
}
/**
@@ -1352,7 +1399,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean hasCounters() {
- return counters.size() > 0;
+ return this.counters.size() > 0;
}
/**
@@ -1363,7 +1410,7 @@ public class Card extends GameEntity implements Comparable {
*/
public final int getNumberOfCounters() {
int number = 0;
- for (Integer i : counters.values()) {
+ for (final Integer i : this.counters.values()) {
number += i.intValue();
}
return number;
@@ -1391,14 +1438,14 @@ public class Card extends GameEntity implements Comparable {
// sometimes you just need to set the value without being affected by
// DoublingSeason
if (bSetValue) {
- counters.put(counterName, Integer.valueOf(n));
+ this.counters.put(counterName, Integer.valueOf(n));
} else {
- int num = getCounters(counterName);
+ final int num = this.getCounters(counterName);
// if counters on card is less than the setting value, addCounters
if (num < n) {
- addCounter(counterName, n - num);
+ this.addCounter(counterName, n - num);
} else {
- subtractCounter(counterName, num - n);
+ this.subtractCounter(counterName, num - n);
}
}
this.updateObservers();
@@ -1415,7 +1462,7 @@ public class Card extends GameEntity implements Comparable {
* @since 1.0.15
*/
public final void setCounters(final Map allCounters) {
- counters = allCounters;
+ this.counters = allCounters;
}
// get all counters from a card
@@ -1427,7 +1474,7 @@ public class Card extends GameEntity implements Comparable {
* @since 1.0.15
*/
public final void clearCounters() {
- counters = new TreeMap();
+ this.counters = new TreeMap();
}
/**
@@ -1437,7 +1484,7 @@ public class Card extends GameEntity implements Comparable {
* @return true if this creature can "Level up", false otherwise
*/
public final boolean hasLevelUp() {
- return levelUp;
+ return this.levelUp;
}
/**
@@ -1449,7 +1496,7 @@ public class Card extends GameEntity implements Comparable {
* a boolean.
*/
public final void setLevelUp(final boolean b) {
- levelUp = b;
+ this.levelUp = b;
}
/**
@@ -1462,8 +1509,8 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.lang.String} object.
*/
public final String getSVar(final String var) {
- if (getCharacteristics().getsVars().containsKey(var)) {
- return getCharacteristics().getsVars().get(var);
+ if (this.getCharacteristics().getsVars().containsKey(var)) {
+ return this.getCharacteristics().getsVars().get(var);
} else {
return "";
}
@@ -1480,11 +1527,11 @@ public class Card extends GameEntity implements Comparable {
* a {@link java.lang.String} object.
*/
public final void setSVar(final String var, final String str) {
- if (getCharacteristics().getsVars().containsKey(var)) {
- getCharacteristics().getsVars().remove(var);
+ if (this.getCharacteristics().getsVars().containsKey(var)) {
+ this.getCharacteristics().getsVars().remove(var);
}
- getCharacteristics().getsVars().put(var, str);
+ this.getCharacteristics().getsVars().put(var, str);
}
/**
@@ -1495,7 +1542,7 @@ public class Card extends GameEntity implements Comparable {
* @return a Map object.
*/
public final Map getSVars() {
- return getCharacteristics().getsVars();
+ return this.getCharacteristics().getsVars();
}
/**
@@ -1507,7 +1554,7 @@ public class Card extends GameEntity implements Comparable {
* a Map object.
*/
public final void setSVars(final Map newSVars) {
- getCharacteristics().setsVars(newSVars);
+ this.getCharacteristics().setsVars(newSVars);
}
/**
@@ -1518,11 +1565,11 @@ public class Card extends GameEntity implements Comparable {
* @return a int.
*/
public final int sumAllCounters() {
- Object[] values = counters.values().toArray();
+ final Object[] values = this.counters.values().toArray();
int count = 0;
int num = 0;
- for (int i = 0; i < values.length; i++) {
- num = (Integer) values[i];
+ for (final Object value2 : values) {
+ num = (Integer) value2;
count += num;
}
return count;
@@ -1536,7 +1583,7 @@ public class Card extends GameEntity implements Comparable {
* @return a int.
*/
public final int getNetPTCounters() {
- return getCounters(Counters.P1P1) - getCounters(Counters.M1M1);
+ return this.getCounters(Counters.P1P1) - this.getCounters(Counters.M1M1);
}
/**
@@ -1547,7 +1594,7 @@ public class Card extends GameEntity implements Comparable {
* @return a int.
*/
public final int getTurnInZone() {
- return turnInZone;
+ return this.turnInZone;
}
/**
@@ -1559,7 +1606,7 @@ public class Card extends GameEntity implements Comparable {
* a int.
*/
public final void setTurnInZone(final int turn) {
- turnInZone = turn;
+ this.turnInZone = turn;
}
/**
@@ -1571,7 +1618,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link java.lang.String} object.
*/
public final void setEchoCost(final String s) {
- echoCost = s;
+ this.echoCost = s;
}
/**
@@ -1582,7 +1629,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.lang.String} object.
*/
public final String getEchoCost() {
- return echoCost;
+ return this.echoCost;
}
/**
@@ -1594,7 +1641,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link java.lang.String} object.
*/
public final void setManaCost(final String s) {
- getCharacteristics().setManaCost(s);
+ this.getCharacteristics().setManaCost(s);
}
/**
@@ -1605,7 +1652,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.lang.String} object.
*/
public final String getManaCost() {
- return getCharacteristics().getManaCost();
+ return this.getCharacteristics().getManaCost();
}
/**
@@ -1620,7 +1667,7 @@ public class Card extends GameEntity implements Comparable {
if (s.equals("")) {
s = "0";
}
- getCharacteristics().getCardColor().add(new CardColor(new ManaCost(s), this, false, true));
+ this.getCharacteristics().getCardColor().add(new CardColor(new ManaCost(s), this, false, true));
}
/**
@@ -1642,7 +1689,7 @@ public class Card extends GameEntity implements Comparable {
if (bIncrease) {
CardColor.increaseTimestamp();
}
- getCharacteristics().getCardColor().add(new CardColor(new ManaCost(s), c, addToColors, false));
+ this.getCharacteristics().getCardColor().add(new CardColor(new ManaCost(s), c, addToColors, false));
return CardColor.getTimestamp();
}
@@ -1662,14 +1709,14 @@ public class Card extends GameEntity implements Comparable {
*/
public final void removeColor(final String s, final Card c, final boolean addTo, final long timestampIn) {
CardColor removeCol = null;
- for (CardColor cc : getCharacteristics().getCardColor()) {
+ for (final CardColor cc : this.getCharacteristics().getCardColor()) {
if (cc.equals(s, c, addTo, timestampIn)) {
removeCol = cc;
}
}
if (removeCol != null) {
- getCharacteristics().getCardColor().remove(removeCol);
+ this.getCharacteristics().getCardColor().remove(removeCol);
}
}
@@ -1685,8 +1732,8 @@ public class Card extends GameEntity implements Comparable {
return new CardColor(this);
}
CardColor colors = null;
- ArrayList globalChanges = AllZone.getColorChanger().getColorChanges();
- colors = determineColor(globalChanges);
+ final ArrayList globalChanges = AllZone.getColorChanger().getColorChanges();
+ colors = this.determineColor(globalChanges);
colors.fixColorless();
return colors;
}
@@ -1700,7 +1747,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link java.util.ArrayList} object.
*/
public final void setColor(final ArrayList colors) {
- getCharacteristics().setCardColor(colors);
+ this.getCharacteristics().setCardColor(colors);
}
/**
@@ -1711,7 +1758,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getColor() {
- return getCharacteristics().getCardColor();
+ return this.getCharacteristics().getCardColor();
}
/**
@@ -1723,18 +1770,18 @@ public class Card extends GameEntity implements Comparable {
* @return a Card_Color
*/
final CardColor determineColor(final ArrayList globalChanges) {
- CardColor colors = new CardColor(this);
- int i = getCharacteristics().getCardColor().size() - 1;
+ final CardColor colors = new CardColor(this);
+ int i = this.getCharacteristics().getCardColor().size() - 1;
int j = -1;
if (globalChanges != null) {
j = globalChanges.size() - 1;
}
// if both have changes, see which one is most recent
- while (i >= 0 && j >= 0) {
+ while ((i >= 0) && (j >= 0)) {
CardColor cc = null;
- if (getCharacteristics().getCardColor().get(i).getStamp() > globalChanges.get(j).getStamp()) {
+ if (this.getCharacteristics().getCardColor().get(i).getStamp() > globalChanges.get(j).getStamp()) {
// Card has a more recent color stamp
- cc = getCharacteristics().getCardColor().get(i);
+ cc = this.getCharacteristics().getCardColor().get(i);
i--;
} else {
// Global effect has a more recent color stamp
@@ -1742,7 +1789,7 @@ public class Card extends GameEntity implements Comparable {
j--;
}
- for (String s : cc.toStringArray()) {
+ for (final String s : cc.toStringArray()) {
colors.addToCardColor(s);
}
if (!cc.getAdditional()) {
@@ -1750,9 +1797,9 @@ public class Card extends GameEntity implements Comparable {
}
}
while (i >= 0) {
- CardColor cc = getCharacteristics().getCardColor().get(i);
+ final CardColor cc = this.getCharacteristics().getCardColor().get(i);
i--;
- for (String s : cc.toStringArray()) {
+ for (final String s : cc.toStringArray()) {
colors.addToCardColor(s);
}
if (!cc.getAdditional()) {
@@ -1760,9 +1807,9 @@ public class Card extends GameEntity implements Comparable {
}
}
while (j >= 0) {
- CardColor cc = globalChanges.get(j);
+ final CardColor cc = globalChanges.get(j);
j--;
- for (String s : cc.toStringArray()) {
+ for (final String s : cc.toStringArray()) {
colors.addToCardColor(s);
}
if (!cc.getAdditional()) {
@@ -1781,7 +1828,7 @@ public class Card extends GameEntity implements Comparable {
* @return a int.
*/
public final int getCMC() {
- return CardUtil.getConvertedManaCost(getCharacteristics().getManaCost());
+ return CardUtil.getConvertedManaCost(this.getCharacteristics().getManaCost());
}
/**
@@ -1793,7 +1840,7 @@ public class Card extends GameEntity implements Comparable {
* @since 1.1.6
*/
public final Player getChosenPlayer() {
- return chosenPlayer;
+ return this.chosenPlayer;
}
/**
@@ -1806,7 +1853,7 @@ public class Card extends GameEntity implements Comparable {
* @since 1.1.6
*/
public final void setChosenPlayer(final Player p) {
- chosenPlayer = p;
+ this.chosenPlayer = p;
}
/**
@@ -1817,7 +1864,7 @@ public class Card extends GameEntity implements Comparable {
* @return an int
*/
public final int getChosenNumber() {
- return chosenNumber;
+ return this.chosenNumber;
}
/**
@@ -1829,7 +1876,7 @@ public class Card extends GameEntity implements Comparable {
* an int
*/
public final void setChosenNumber(final int i) {
- chosenNumber = i;
+ this.chosenNumber = i;
}
// used for cards like Belbe's Portal, Conspiracy, Cover of Darkness, etc.
@@ -1841,7 +1888,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.lang.String} object.
*/
public final String getChosenType() {
- return chosenType;
+ return this.chosenType;
}
/**
@@ -1853,7 +1900,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link java.lang.String} object.
*/
public final void setChosenType(final String s) {
- chosenType = s;
+ this.chosenType = s;
}
/**
@@ -1864,7 +1911,7 @@ public class Card extends GameEntity implements Comparable {
* @return an ArrayList object.
*/
public final ArrayList getChosenColor() {
- return chosenColor;
+ return this.chosenColor;
}
/**
@@ -1876,7 +1923,7 @@ public class Card extends GameEntity implements Comparable {
* an ArrayList object.
*/
public final void setChosenColor(final ArrayList s) {
- chosenColor = s;
+ this.chosenColor = s;
}
// used for cards like Meddling Mage...
@@ -1888,7 +1935,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.lang.String} object.
*/
public final String getNamedCard() {
- return namedCard;
+ return this.namedCard;
}
/**
@@ -1900,7 +1947,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link java.lang.String} object.
*/
public final void setNamedCard(final String s) {
- namedCard = s;
+ this.namedCard = s;
}
/**
@@ -1912,7 +1959,7 @@ public class Card extends GameEntity implements Comparable {
* a boolean.
*/
public final void setDrawnThisTurn(final boolean b) {
- drawnThisTurn = b;
+ this.drawnThisTurn = b;
}
/**
@@ -1923,7 +1970,7 @@ public class Card extends GameEntity implements Comparable {
* @return a boolean.
*/
public final boolean getDrawnThisTurn() {
- return drawnThisTurn;
+ return this.drawnThisTurn;
}
/**
@@ -1934,7 +1981,7 @@ public class Card extends GameEntity implements Comparable {
* @return a list of cards this card has gained control of
*/
public final ArrayList getGainControlTargets() {
- return gainControlTargets;
+ return this.gainControlTargets;
}
/**
@@ -1946,7 +1993,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link forge.Card} object.
*/
public final void addGainControlTarget(final Card c) {
- gainControlTargets.add(c);
+ this.gainControlTargets.add(c);
}
/**
@@ -1955,7 +2002,7 @@ public class Card extends GameEntity implements Comparable {
* used primarily with AbilityFactory_GainControl
*/
public final void clearGainControlTargets() {
- gainControlTargets.clear();
+ this.gainControlTargets.clear();
}
/**
@@ -1968,7 +2015,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getGainControlReleaseCommands() {
- return gainControlReleaseCommands;
+ return this.gainControlReleaseCommands;
}
/**
@@ -1982,7 +2029,7 @@ public class Card extends GameEntity implements Comparable {
* the Command to be executed
*/
public final void addGainControlReleaseCommand(final Command c) {
- gainControlReleaseCommands.add(c);
+ this.gainControlReleaseCommands.add(c);
}
/**
@@ -1991,7 +2038,7 @@ public class Card extends GameEntity implements Comparable {
*
*/
public final void clearGainControlReleaseCommands() {
- gainControlReleaseCommands.clear();
+ this.gainControlReleaseCommands.clear();
}
/**
@@ -2002,7 +2049,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.lang.String} object.
*/
public final String getSpellText() {
- return text;
+ return this.text;
}
/**
@@ -2014,7 +2061,7 @@ public class Card extends GameEntity implements Comparable {
* a {@link java.lang.String} object.
*/
public final void setText(final String t) {
- text = t;
+ this.text = t;
}
// get the text that should be displayed
@@ -2026,16 +2073,17 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.lang.String} object.
*/
public String getText() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(this.getAbilityText());
- String nonAbilityText = getNonAbilityText();
+ final String nonAbilityText = this.getNonAbilityText();
if (nonAbilityText.length() > 0) {
sb.append("\r\n \r\nNon ability features: \r\n");
- sb.append(nonAbilityText.replaceAll("CARDNAME", getName()));
+ sb.append(nonAbilityText.replaceAll("CARDNAME", this.getName()));
}
-
- if(characteristicsMap.get("Cloner") != null) {
- sb.append("\r\nCloned by:").append(characteristicsMap.get("Cloner").getName()).append(" (").append(getUniqueNumber()).append(")");
+
+ if (this.characteristicsMap.get("Cloner") != null) {
+ sb.append("\r\nCloned by:").append(this.characteristicsMap.get("Cloner").getName()).append(" (")
+ .append(this.getUniqueNumber()).append(")");
}
return sb.toString();
@@ -2051,10 +2099,10 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.lang.String} object.
*/
public final String getNonAbilityText() {
- StringBuilder sb = new StringBuilder();
- ArrayList keyword = getHiddenExtrinsicKeyword();
+ final StringBuilder sb = new StringBuilder();
+ final ArrayList keyword = this.getHiddenExtrinsicKeyword();
- sb.append(keywordsToText(keyword));
+ sb.append(this.keywordsToText(keyword));
return sb.toString();
}
@@ -2070,9 +2118,9 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.lang.String} object.
*/
public final String keywordsToText(final ArrayList keyword) {
- StringBuilder sb = new StringBuilder();
- StringBuilder sbLong = new StringBuilder();
- StringBuilder sbMana = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
+ final StringBuilder sbLong = new StringBuilder();
+ final StringBuilder sbMana = new StringBuilder();
for (int i = 0; i < keyword.size(); i++) {
if (!keyword.get(i).toString().contains("CostChange")
@@ -2082,13 +2130,13 @@ public class Card extends GameEntity implements Comparable {
&& !keyword.get(i).toString().contains("CantBlock")
&& !keyword.get(i).toString().contains("CantBeBlockedBy")) {
if (keyword.get(i).toString().contains("StaticEffect")) {
- String[] k = keyword.get(i).split(":");
+ final String[] k = keyword.get(i).split(":");
sbLong.append(k[5]).append("\r\n");
} else if (keyword.get(i).toString().contains("Protection:")) {
- String[] k = keyword.get(i).split(":");
+ final String[] k = keyword.get(i).split(":");
sbLong.append(k[2]).append("\r\n");
} else if (keyword.get(i).toString().contains("Creatures can't attack unless their controller pays")) {
- String[] k = keyword.get(i).split(":");
+ final String[] k = keyword.get(i).split(":");
if (!k[3].equals("no text")) {
sbLong.append(k[3]).append("\r\n");
}
@@ -2105,8 +2153,8 @@ public class Card extends GameEntity implements Comparable {
k = k.replace(":", " ");
sbLong.append(k).append("\r\n");
} else if (keyword.get(i).startsWith("Champion")) {
- String k = getKeyword().get(i);
- String[] kk = k.split(":");
+ final String k = this.getKeyword().get(i);
+ final String[] kk = k.split(":");
String types = kk[1];
if (kk.length > 2) {
types = kk[2];
@@ -2133,8 +2181,8 @@ public class Card extends GameEntity implements Comparable {
} else if (keyword.get(i).toString().contains("tap: add ")) {
sbMana.append(keyword.get(i).toString()).append("\r\n");
} else if (keyword.get(i).contains("Bloodthirst")) {
- String k = keyword.get(i);
- String[] kk = k.split(" ");
+ final String k = keyword.get(i);
+ final String[] kk = k.split(" ");
sbLong.append(keyword.get(i)).append(
" (If an opponent was dealt damage this turn, this creature enters the battlefield with ");
sbLong.append(kk[1]).append(" +1/+1 counter");
@@ -2148,7 +2196,7 @@ public class Card extends GameEntity implements Comparable {
sbLong.append(" on it.)").append("\r\n");
}
} else if (keyword.get(i).startsWith("Modular")) {
- String numCounters = keyword.get(i).split(" ")[1];
+ final String numCounters = keyword.get(i).split(" ")[1];
sbLong.append(keyword.get(i));
sbLong.append(" (This enters the battlefield with ");
sbLong.append(numCounters);
@@ -2162,7 +2210,7 @@ public class Card extends GameEntity implements Comparable {
continue;
} else if (keyword.get(i).contains("Haunt")) {
sb.append("\r\nHaunt (");
- if (isCreature()) {
+ if (this.isCreature()) {
sb.append("When this creature dies, exile it haunting target creature.");
} else {
sb.append("When this spell card is put into a graveyard after resolving, ");
@@ -2173,7 +2221,7 @@ public class Card extends GameEntity implements Comparable {
} else if (keyword.get(i).equals("Convoke")) {
sb.append("Convoke (Each creature you tap while casting this spell reduces its cost by 1 or by one mana of that creature's color.)");
} else {
- if (i != 0 && sb.length() != 0) {
+ if ((i != 0) && (sb.length() != 0)) {
sb.append(", ");
}
sb.append(keyword.get(i).toString());
@@ -2200,11 +2248,11 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.lang.String} object.
*/
public String getAbilityText() {
- if (isInstant() || isSorcery()) {
- StringBuilder sb = abilityTextInstantSorcery();
+ if (this.isInstant() || this.isSorcery()) {
+ final StringBuilder sb = this.abilityTextInstantSorcery();
- if (haunting != null) {
- sb.append("Haunting: ").append(haunting);
+ if (this.haunting != null) {
+ sb.append("Haunting: ").append(this.haunting);
sb.append("\r\n");
}
@@ -2212,17 +2260,17 @@ public class Card extends GameEntity implements Comparable {
sb.delete(sb.lastIndexOf("\r\n"), sb.lastIndexOf("\r\n") + 3);
}
- return sb.toString().replaceAll("CARDNAME", getName());
+ return sb.toString().replaceAll("CARDNAME", this.getName());
}
- StringBuilder sb = new StringBuilder();
- ArrayList keyword = getUnhiddenKeyword();
+ final StringBuilder sb = new StringBuilder();
+ final ArrayList keyword = this.getUnhiddenKeyword();
- sb.append(keywordsToText(keyword));
+ sb.append(this.keywordsToText(keyword));
// Give spellText line breaks for easier reading
sb.append("\r\n");
- sb.append(text.replaceAll("\\\\r\\\\n", "\r\n"));
+ sb.append(this.text.replaceAll("\\\\r\\\\n", "\r\n"));
sb.append("\r\n");
/*
@@ -2232,33 +2280,33 @@ public class Card extends GameEntity implements Comparable {
*/
// Triggered abilities
- for (Trigger trig : getCharacteristics().getTriggers()) {
+ for (final Trigger trig : this.getCharacteristics().getTriggers()) {
if (!trig.isSecondary()) {
sb.append(trig.toString() + "\r\n");
}
}
// static abilities
- for (StaticAbility stAb : getCharacteristics().getStaticAbilities()) {
+ for (final StaticAbility stAb : this.getCharacteristics().getStaticAbilities()) {
sb.append(stAb.toString() + "\r\n");
}
- ArrayList addedManaStrings = new ArrayList();
- SpellAbility[] abilities = getSpellAbility();
+ final ArrayList addedManaStrings = new ArrayList();
+ final SpellAbility[] abilities = this.getSpellAbility();
boolean primaryCost = true;
- for (SpellAbility sa : abilities) {
+ for (final SpellAbility sa : abilities) {
// only add abilities not Spell portions of cards
- if (!isPermanent()) {
+ if (!this.isPermanent()) {
continue;
}
- if (sa instanceof SpellPermanent && primaryCost && !isAura()) {
+ if ((sa instanceof SpellPermanent) && primaryCost && !this.isAura()) {
// For Alt costs, make sure to display the cost!
primaryCost = false;
continue;
}
- String sAbility = sa.toString();
+ final String sAbility = sa.toString();
if (sa instanceof AbilityMana) {
if (addedManaStrings.contains(sAbility)) {
@@ -2267,10 +2315,10 @@ public class Card extends GameEntity implements Comparable {
addedManaStrings.add(sAbility);
}
- if (sa instanceof SpellPermanent && !isAura()) {
+ if ((sa instanceof SpellPermanent) && !this.isAura()) {
sb.insert(0, "\r\n");
sb.insert(0, sAbility);
- } else if (!sAbility.endsWith(getName())) {
+ } else if (!sAbility.endsWith(this.getName())) {
sb.append(sAbility);
sb.append("\r\n");
// The test above appears to prevent the card name from showing
@@ -2293,21 +2341,21 @@ public class Card extends GameEntity implements Comparable {
// replace tripple line feeds with double line feeds
int start;
- String s = "\r\n\r\n\r\n";
+ final String s = "\r\n\r\n\r\n";
while (sb.toString().contains(s)) {
start = sb.lastIndexOf(s);
- if (start < 0 || start >= sb.length()) {
+ if ((start < 0) || (start >= sb.length())) {
break;
}
sb.replace(start, start + 4, "\r\n");
}
// Remembered cards
- if (rememberedObjects.size() > 0) {
+ if (this.rememberedObjects.size() > 0) {
sb.append("\r\nRemembered: \r\n");
- for (Object o : rememberedObjects) {
+ for (final Object o : this.rememberedObjects) {
if (o instanceof Card) {
- Card c = (Card) o;
+ final Card c = (Card) o;
if (c.isFaceDown()) {
sb.append("Face Down ");
} else {
@@ -2323,17 +2371,17 @@ public class Card extends GameEntity implements Comparable {
}
}
- if (hauntedBy.size() != 0) {
+ if (this.hauntedBy.size() != 0) {
sb.append("Haunted by: ");
- for (Card c : hauntedBy) {
+ for (final Card c : this.hauntedBy) {
sb.append(c).append(",");
}
sb.deleteCharAt(sb.length() - 1);
sb.append("\r\n");
}
- if (haunting != null) {
- sb.append("Haunting: ").append(haunting);
+ if (this.haunting != null) {
+ sb.append("Haunting: ").append(this.haunting);
sb.append("\r\n");
}
@@ -2342,16 +2390,17 @@ public class Card extends GameEntity implements Comparable {
* sb.append("Controller(s):"); for(Object o : controllerObjects) {
* sb.append(o); } sb.append("\r\n");
*/
- return sb.toString().replaceAll("CARDNAME", getName()).trim();
+ return sb.toString().replaceAll("CARDNAME", this.getName()).trim();
} // getText()
/**
* TODO: Write javadoc for this method.
+ *
* @return
*/
private StringBuilder abilityTextInstantSorcery() {
- String s = getSpellText();
- StringBuilder sb = new StringBuilder();
+ final String s = this.getSpellText();
+ final StringBuilder sb = new StringBuilder();
// Give spellText line breaks for easier reading
sb.append(s.replaceAll("\\\\r\\\\n", "\r\n"));
@@ -2365,24 +2414,24 @@ public class Card extends GameEntity implements Comparable {
}
// Add SpellAbilities
- SpellAbility[] sa = getSpellAbility();
- for (int i = 0; i < sa.length; i++) {
- sb.append(sa[i].toString() + "\r\n");
+ final SpellAbility[] sa = this.getSpellAbility();
+ for (final SpellAbility element : sa) {
+ sb.append(element.toString() + "\r\n");
}
// Add Keywords
- ArrayList kw = getKeyword();
+ final ArrayList kw = this.getKeyword();
// Triggered abilities
- for (Trigger trig : getCharacteristics().getTriggers()) {
+ for (final Trigger trig : this.getCharacteristics().getTriggers()) {
if (!trig.isSecondary()) {
sb.append(trig.toString() + "\r\n");
}
}
// static abilities
- for (StaticAbility stAb : getCharacteristics().getStaticAbilities()) {
- String stAbD = stAb.toString();
+ for (final StaticAbility stAb : this.getCharacteristics().getStaticAbilities()) {
+ final String stAbD = stAb.toString();
if (!stAbD.equals("")) {
sb.append(stAbD + "\r\n");
}
@@ -2390,7 +2439,7 @@ public class Card extends GameEntity implements Comparable {
// Ripple + Dredge + Madness + CARDNAME is {color} + Recover.
for (int i = 0; i < kw.size(); i++) {
- String keyword = kw.get(i);
+ final String keyword = kw.get(i);
if ((keyword.startsWith("Ripple") && !sb.toString().contains("Ripple"))
|| (keyword.startsWith("Dredge") && !sb.toString().contains("Dredge"))
|| (keyword.startsWith("Madness") && !sb.toString().contains("Madness"))
@@ -2407,8 +2456,8 @@ public class Card extends GameEntity implements Comparable {
if (keyword.startsWith("Flashback")) {
sb.append("Flashback");
if (keyword.contains(" ")) {
- final Cost fbCost = new Cost(keyword.substring(10), getName(), true);
- sb.append(" "+fbCost.toString()).delete(sb.length()-2, sb.length()-1);
+ final Cost fbCost = new Cost(keyword.substring(10), this.getName(), true);
+ sb.append(" " + fbCost.toString()).delete(sb.length() - 2, sb.length() - 1);
}
sb.append("\r\n");
}
@@ -2438,7 +2487,7 @@ public class Card extends GameEntity implements Comparable {
sb.delete(sb.lastIndexOf("\r\n"), sb.lastIndexOf("\r\n") + 3);
}
sb.append("Haunt (");
- if (isCreature()) {
+ if (this.isCreature()) {
sb.append("When this creature dies, exile it haunting target creature.");
} else {
sb.append("When this spell card is put into a graveyard after resolving, ");
@@ -2464,7 +2513,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getManaAbility() {
- return new ArrayList(getCharacteristics().getManaAbility());
+ return new ArrayList(this.getCharacteristics().getManaAbility());
}
// Returns basic mana abilities plus "reflected mana" abilities
@@ -2476,11 +2525,11 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getAIPlayableMana() {
- ArrayList res = new ArrayList();
- for (AbilityMana am : getManaAbility()) {
+ final ArrayList res = new ArrayList();
+ for (final AbilityMana am : this.getManaAbility()) {
// if a mana ability has a mana cost the AI will miscalculate
- Cost cost = am.getPayCosts();
+ final Cost cost = am.getPayCosts();
if (!cost.hasNoManaCost()) {
continue;
}
@@ -2504,8 +2553,8 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getBasicMana() {
- ArrayList res = new ArrayList();
- for (AbilityMana am : getManaAbility()) {
+ final ArrayList res = new ArrayList();
+ for (final AbilityMana am : this.getManaAbility()) {
if (am.isBasic() && !res.contains(am)) {
res.add(am);
}
@@ -2519,9 +2568,9 @@ public class Card extends GameEntity implements Comparable {
*
*/
public final void clearFirstSpell() {
- for (int i = 0; i < getCharacteristics().getSpellAbility().size(); i++) {
- if (getCharacteristics().getSpellAbility().get(i).isSpell()) {
- getCharacteristics().getSpellAbility().remove(i);
+ for (int i = 0; i < this.getCharacteristics().getSpellAbility().size(); i++) {
+ if (this.getCharacteristics().getSpellAbility().get(i).isSpell()) {
+ this.getCharacteristics().getSpellAbility().remove(i);
return;
}
}
@@ -2533,12 +2582,12 @@ public class Card extends GameEntity implements Comparable {
*
*/
public final void clearAllButFirstSpellAbility() {
- if (!getCharacteristics().getSpellAbility().isEmpty()) {
- SpellAbility first = getCharacteristics().getSpellAbility().get(0);
- getCharacteristics().getSpellAbility().clear();
- getCharacteristics().getSpellAbility().add(first);
+ if (!this.getCharacteristics().getSpellAbility().isEmpty()) {
+ final SpellAbility first = this.getCharacteristics().getSpellAbility().get(0);
+ this.getCharacteristics().getSpellAbility().clear();
+ this.getCharacteristics().getSpellAbility().add(first);
}
- getCharacteristics().getManaAbility().clear();
+ this.getCharacteristics().getManaAbility().clear();
}
/**
@@ -2549,13 +2598,13 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getAllButFirstSpellAbility() {
- ArrayList sas = new ArrayList();
- sas.addAll(getCharacteristics().getSpellAbility());
+ final ArrayList sas = new ArrayList();
+ sas.addAll(this.getCharacteristics().getSpellAbility());
if (!sas.isEmpty()) {
- SpellAbility first = getCharacteristics().getSpellAbility().get(0);
+ final SpellAbility first = this.getCharacteristics().getSpellAbility().get(0);
sas.remove(first);
}
- sas.addAll(getCharacteristics().getManaAbility());
+ sas.addAll(this.getCharacteristics().getManaAbility());
return sas;
}
@@ -2566,8 +2615,8 @@ public class Card extends GameEntity implements Comparable {
*
*/
public final void clearSpellAbility() {
- getCharacteristics().getSpellAbility().clear();
- getCharacteristics().getManaAbility().clear();
+ this.getCharacteristics().getSpellAbility().clear();
+ this.getCharacteristics().getManaAbility().clear();
}
/**
@@ -2578,7 +2627,7 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link forge.card.spellability.SpellPermanent} object.
*/
public final SpellPermanent getSpellPermanent() {
- for (SpellAbility sa : getCharacteristics().getSpellAbility()) {
+ for (final SpellAbility sa : this.getCharacteristics().getSpellAbility()) {
if (sa instanceof SpellPermanent) {
return (SpellPermanent) sa;
}
@@ -2592,7 +2641,7 @@ public class Card extends GameEntity implements Comparable {
*
*/
public final void clearSpellKeepManaAbility() {
- getCharacteristics().getSpellAbility().clear();
+ this.getCharacteristics().getSpellAbility().clear();
}
/**
@@ -2601,7 +2650,7 @@ public class Card extends GameEntity implements Comparable {
*
*/
public final void clearManaAbility() {
- getCharacteristics().getManaAbility().clear();
+ this.getCharacteristics().getManaAbility().clear();
}
/**
@@ -2615,9 +2664,9 @@ public class Card extends GameEntity implements Comparable {
public final void addFirstSpellAbility(final SpellAbility a) {
a.setSourceCard(this);
if (a instanceof AbilityMana) {
- getCharacteristics().getManaAbility().add(0, (AbilityMana) a);
+ this.getCharacteristics().getManaAbility().add(0, (AbilityMana) a);
} else {
- getCharacteristics().getSpellAbility().add(0, a);
+ this.getCharacteristics().getSpellAbility().add(0, a);
}
}
@@ -2632,9 +2681,9 @@ public class Card extends GameEntity implements Comparable {
public final void addSpellAbility(final SpellAbility a) {
a.setSourceCard(this);
if (a instanceof AbilityMana) {
- getCharacteristics().getManaAbility().add((AbilityMana) a);
+ this.getCharacteristics().getManaAbility().add((AbilityMana) a);
} else {
- getCharacteristics().getSpellAbility().add(a);
+ this.getCharacteristics().getSpellAbility().add(a);
}
}
@@ -2650,9 +2699,9 @@ public class Card extends GameEntity implements Comparable {
if (a instanceof AbilityMana) {
// if (a.isExtrinsic()) //never remove intrinsic mana abilities, is
// this the way to go??
- getCharacteristics().getManaAbility().remove(a);
+ this.getCharacteristics().getManaAbility().remove(a);
} else {
- getCharacteristics().getSpellAbility().remove(a);
+ this.getCharacteristics().getSpellAbility().remove(a);
}
}
@@ -2663,15 +2712,15 @@ public class Card extends GameEntity implements Comparable {
*/
public final void removeAllExtrinsicManaAbilities() {
// temp ArrayList, otherwise ConcurrentModificationExceptions occur:
- ArrayList saList = new ArrayList();
+ final ArrayList saList = new ArrayList();
- for (SpellAbility var : getCharacteristics().getManaAbility()) {
+ for (final SpellAbility var : this.getCharacteristics().getManaAbility()) {
if (var.isExtrinsic()) {
saList.add(var);
}
}
- for (SpellAbility sa : saList) {
- removeSpellAbility(sa);
+ for (final SpellAbility sa : saList) {
+ this.removeSpellAbility(sa);
}
}
@@ -2683,8 +2732,8 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getIntrinsicManaAbilitiesDescriptions() {
- ArrayList list = new ArrayList();
- for (SpellAbility var : getCharacteristics().getManaAbility()) {
+ final ArrayList list = new ArrayList();
+ for (final SpellAbility var : this.getCharacteristics().getManaAbility()) {
if (var.isIntrinsic()) {
list.add(var.toString());
}
@@ -2700,9 +2749,9 @@ public class Card extends GameEntity implements Comparable {
* @return an array of {@link forge.card.spellability.SpellAbility} objects.
*/
public final SpellAbility[] getSpellAbility() {
- ArrayList res = new ArrayList(getCharacteristics().getSpellAbility());
- res.addAll(getManaAbility());
- SpellAbility[] s = new SpellAbility[res.size()];
+ final ArrayList res = new ArrayList(this.getCharacteristics().getSpellAbility());
+ res.addAll(this.getManaAbility());
+ final SpellAbility[] s = new SpellAbility[res.size()];
res.toArray(s);
return s;
}
@@ -2715,8 +2764,8 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getSpellAbilities() {
- ArrayList res = new ArrayList(getCharacteristics().getSpellAbility());
- res.addAll(getManaAbility());
+ final ArrayList res = new ArrayList(this.getCharacteristics().getSpellAbility());
+ res.addAll(this.getManaAbility());
return res;
}
@@ -2727,15 +2776,15 @@ public class Card extends GameEntity implements Comparable {
* @return ArrayList
*/
public final ArrayList getAllSpellAbilities() {
- ArrayList res = new ArrayList();
+ final ArrayList res = new ArrayList();
- String curState = curCharacteristics;
- for(String key : characteristicsMap.keySet()) {
- setState(key);
- res.addAll(getSpellAbilities());
+ final String curState = this.curCharacteristics;
+ for (final String key : this.characteristicsMap.keySet()) {
+ this.setState(key);
+ res.addAll(this.getSpellAbilities());
}
-
- setState(curState);
+
+ this.setState(curState);
return res;
}
@@ -2748,10 +2797,10 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getSpells() {
- ArrayList s = new ArrayList(getCharacteristics().getSpellAbility());
- ArrayList res = new ArrayList();
+ final ArrayList s = new ArrayList(this.getCharacteristics().getSpellAbility());
+ final ArrayList res = new ArrayList();
- for (SpellAbility sa : s) {
+ for (final SpellAbility sa : s) {
if (sa.isSpell()) {
res.add(sa);
}
@@ -2767,10 +2816,10 @@ public class Card extends GameEntity implements Comparable {
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList getBasicSpells() {
- ArrayList s = new ArrayList(getCharacteristics().getSpellAbility());
- ArrayList res = new ArrayList();
+ final ArrayList