- removed the unnecessary variable targetsForChoices from the Card class.

This commit is contained in:
Sloth
2012-07-26 20:30:35 +00:00
parent 9681b5bf4b
commit fc0678f8a5
2 changed files with 8 additions and 58 deletions

View File

@@ -105,8 +105,7 @@ public class Card extends GameEntity implements Comparable<Card> {
// if this card is an Aura, what Entity is it enchanting?
private GameEntity enchanting = null;
private ArrayList<String> prevType = new ArrayList<String>();
private final ArrayList<String> choicesMade = new ArrayList<String>();
private final ArrayList<String> targetsForChoices = new ArrayList<String>();
private ArrayList<String> choicesMade = null;
// changes by AF animate and continuous static effects
private ArrayList<CardType> changedCardTypes = new ArrayList<CardType>();
@@ -265,7 +264,7 @@ public class Card extends GameEntity implements Comparable<Card> {
return true;
}
/**
* Sets the state.
*
@@ -3167,14 +3166,14 @@ public class Card extends GameEntity implements Comparable<Card> {
/**
* <p>
* addSpellChoice.
* setSpellChoice.
* </p>
*
* @param string
* a {@link java.lang.String} object.
* @param strings
* a ArrayList<String> object.
*/
public final void addSpellChoice(final String string) {
this.choicesMade.add(string);
public final void setSpellChoice(final ArrayList<String> strings) {
this.choicesMade = strings;
}
/**
@@ -3201,42 +3200,6 @@ public class Card extends GameEntity implements Comparable<Card> {
return this.choicesMade.get(i);
}
/**
* <p>
* setSpellChoiceTarget.
* </p>
*
* @param string
* a {@link java.lang.String} object.
*/
public final void setSpellChoiceTarget(final String string) {
this.targetsForChoices.add(string);
}
/**
* <p>
* getChoiceTargets.
* </p>
*
* @return a {@link java.util.ArrayList} object.
*/
public final ArrayList<String> getChoiceTargets() {
return this.targetsForChoices;
}
/**
* <p>
* getChoiceTarget.
* </p>
*
* @param i
* a int.
* @return a {@link java.lang.String} object.
*/
public final String getChoiceTarget(final int i) {
return this.targetsForChoices.get(i);
}
/**
* <p>
* setSpellWithChoices.

View File

@@ -1479,12 +1479,7 @@ public class CardFactorySorceries {
@Override
public void selectCard(final Card c, final PlayerZone zone) {
if (c.isCreature() && zone.is(ZoneType.Battlefield) && c.canBeTargetedBy(spell)) {
if (card.isCopiedSpell()) {
card.getChoiceTargets().remove(0);
}
ab2card[0] = c;
// spell.setTargetCard(c);
card.setSpellChoiceTarget(String.valueOf(c.getUniqueNumber()));
setStackDescription.execute();
if (userChoice.contains(cardChoice[3]) || card.getChoices().contains(cardChoice[3])) {
@@ -1560,12 +1555,7 @@ public class CardFactorySorceries {
@Override
public void selectPlayer(final Player player) {
if (player.canBeTargetedBy(spell)) {
if (card.isCopiedSpell()) {
card.getChoiceTargets().remove(0);
}
ab0player[0] = player;
// spell.setTargetPlayer(player);
card.setSpellChoiceTarget(player.toString());
setStackDescription.execute();
if (userChoice.contains(cardChoice[1]) || card.getChoices().contains(cardChoice[1])) {
@@ -1657,8 +1647,6 @@ public class CardFactorySorceries {
ab1card[0] = null;
ab2card[0] = null;
ab3cards.clear();
card.getChoices().clear();
card.getChoiceTargets().clear();
userChoice.clear();
final ArrayList<String> display = new ArrayList<String>();
@@ -1701,7 +1689,6 @@ public class CardFactorySorceries {
}
out.add((String) o);
card.addSpellChoice((String) o);
choices.remove(out.get(0));
o = GuiUtils.chooseOneOrNone("Choose Two", choices.toArray());
if (o == null) {
@@ -1709,7 +1696,7 @@ public class CardFactorySorceries {
}
out.add((String) o);
card.addSpellChoice((String) o);
card.setSpellChoice(out);
return out;
} // chooseTwo()
}; // Input chooseTwoInput