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

View File

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