Always allow unselecting cards for InputSelectManyBase

This commit is contained in:
drdev
2014-09-13 00:06:14 +00:00
parent bbbdb643ad
commit b084b7c85d
5 changed files with 1 additions and 12 deletions

View File

@@ -17,10 +17,8 @@ public final class InputProliferate extends InputSelectManyBase<GameEntity> {
public InputProliferate() {
super(1, Integer.MAX_VALUE);
allowUnselect = true;
}
protected String getMessage() {
StringBuilder sb = new StringBuilder("Choose permanents and/or players with counters on them to add one more counter of that type.");
sb.append("\n\nYou've selected so far:\n");

View File

@@ -28,11 +28,9 @@ public final class InputSelectCardsForConvoke extends InputSelectManyBase<Card>
super(0, Math.min(cost.getCMC(), untapped.size()));
remainingCost = new ManaCostBeingPaid(cost);
player = p;
allowUnselect = true;
availableCreatures = untapped;
}
protected String getMessage() {
return "Choose creatures to tap for convoke.\nRemaining mana cost is " + remainingCost.toString();
}

View File

@@ -53,8 +53,6 @@ public class InputSelectEntitiesFromList<T extends GameEntity> extends InputSele
boolean entityWasSelected = selected.contains(c);
if (entityWasSelected) {
if (!allowUnselect)
return false;
this.selected.remove(c);
}
else {

View File

@@ -14,7 +14,6 @@ public abstract class InputSelectManyBase<T extends GameEntity> extends InputSyn
protected boolean bCancelled = false;
protected final int min;
protected final int max;
protected boolean allowUnselect = false;
protected boolean allowCancel = false;
protected String message = "Source-Card-Name - Select %d more card(s)";
@@ -86,8 +85,5 @@ public abstract class InputSelectManyBase<T extends GameEntity> extends InputSyn
}
}
public final boolean isUnselectAllowed() { return allowUnselect; }
public final void setUnselectAllowed(boolean allow) { this.allowUnselect = allow; }
public final void setCancelAllowed(boolean allow) { this.allowCancel = allow ; }
}

View File

@@ -824,7 +824,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
}
int tc = getTimesSelected(c);
cardsChosen.put(c, tc+1);
cardsChosen.put(c, tc + 1);
onSelectStateChanged(c, true);
refresh();
@@ -1074,7 +1074,6 @@ public class HumanCostDecision extends CostDecisionMakerBase {
int i = Integer.parseInt(totalP);
InputSelectCardsFromList inp = new InputSelectCardsFromList(0, typeList.size(), typeList);
inp.setMessage("Select a card to tap.");
inp.setUnselectAllowed(true);
inp.setCancelAllowed(true);
inp.showAndWait();