Inputs base class renamed

This commit is contained in:
Maxmtg
2013-03-23 14:00:53 +00:00
parent c30bb25547
commit 3215a5c32c
42 changed files with 140 additions and 136 deletions

View File

@@ -7,7 +7,7 @@ import java.util.concurrent.Executors;
import javax.swing.SwingUtilities;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.error.BugReporter;
/**
@@ -105,7 +105,7 @@ public class FThreads {
invokeInNewThread(toRun);
}
public static final void setInputAndWait(Input inp, CountDownLatch cdl) {
public static final void setInputAndWait(InputBase inp, CountDownLatch cdl) {
checkEDT("FThreads.setInputAndWait", false);
Singletons.getModel().getMatch().getInput().setInputInterrupt(inp);
try {

View File

@@ -14,7 +14,7 @@ import forge.Singletons;
import forge.card.ability.SpellAbilityEffect;
import forge.card.cardfactory.CardFactoryUtil;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.player.Player;
import forge.game.zone.ZoneType;
import forge.gui.GuiChoose;
@@ -45,7 +45,7 @@ public class CountersProliferateEffect extends SpellAbilityEffect {
private static void resolveHuman(final SpellAbility sa) {
final List<Card> unchosen = Lists.newArrayList(Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield));
final List<Player> players = new ArrayList<Player>(Singletons.getModel().getGame().getPlayers());
Singletons.getModel().getMatch().getInput().setInput(new Input() {
Singletons.getModel().getMatch().getInput().setInput(new InputBase() {
private static final long serialVersionUID = -1779224307654698954L;
@Override

View File

@@ -44,7 +44,7 @@ import forge.card.spellability.SpellPermanent;
import forge.card.spellability.Target;
import forge.card.trigger.Trigger;
import forge.card.trigger.TriggerHandler;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.control.input.InputSelectManyCards;
import forge.game.ai.ComputerUtilCard;
import forge.game.ai.ComputerUtilCombat;
@@ -477,7 +477,7 @@ public class CardFactoryCreatures {
private static void getCard_PhyrexianDreadnought(final Card card, final String cardName) {
final Player player = card.getController();
final Input target = new InputSelectManyCards(0, Integer.MAX_VALUE) {
final InputBase target = new InputSelectManyCards(0, Integer.MAX_VALUE) {
private static final long serialVersionUID = 2698036349873486664L;
@Override
@@ -495,7 +495,7 @@ public class CardFactoryCreatures {
}
@Override
protected Input onCancel() {
protected InputBase onCancel() {
Singletons.getModel().getGame().getAction().sacrifice(card, null);
return null;
}
@@ -507,7 +507,7 @@ public class CardFactoryCreatures {
} // selectCard()
@Override
protected Input onDone() {
protected InputBase onDone() {
for (final Card sac : selected) {
Singletons.getModel().getGame().getAction().sacrifice(sac, null);
}

View File

@@ -25,7 +25,7 @@ import forge.Card;
import forge.CardLists;
import forge.Command;
import forge.Singletons;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.control.input.InputSelectManyCards;
import forge.game.player.Player;
import forge.game.zone.Zone;
@@ -76,7 +76,7 @@ class CardFactoryLands {
}
@Override
protected Input onDone() {
protected InputBase onDone() {
if (selected.isEmpty()) {
return onCancel();
}
@@ -87,7 +87,7 @@ class CardFactoryLands {
}
@Override
public Input onCancel() {
public InputBase onCancel() {
card.setTapped(true);
return null;
}

View File

@@ -62,7 +62,7 @@ import forge.card.spellability.Target;
import forge.card.trigger.Trigger;
import forge.card.trigger.TriggerHandler;
import forge.card.trigger.TriggerType;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.control.input.InputSelectManyCards;
import forge.game.GameState;
import forge.game.ai.ComputerUtil;
@@ -98,10 +98,10 @@ public class CardFactoryUtil {
* a {@link forge.CardList} object.
* @param message
* a {@link java.lang.String} object.
* @return a {@link forge.control.input.Input} object.
* @return a {@link forge.control.input.InputBase} object.
*/
public static Input inputDestroyNoRegeneration(final List<Card> choices, final String message) {
final Input target = new Input() {
public static InputBase inputDestroyNoRegeneration(final List<Card> choices, final String message) {
final InputBase target = new InputBase() {
private static final long serialVersionUID = -6637588517573573232L;
@Override
@@ -549,11 +549,11 @@ public class CardFactoryUtil {
* a {@link forge.CardList} object.
* @param paid
* a {@link forge.Command} object.
* @return a {@link forge.control.input.Input} object.
* @return a {@link forge.control.input.InputBase} object.
*/
public static Input masterOfTheWildHuntInputTargetCreature(final SpellAbility spell, final List<Card> choices,
public static InputBase masterOfTheWildHuntInputTargetCreature(final SpellAbility spell, final List<Card> choices,
final Command paid) {
final Input target = new Input() {
final InputBase target = new InputBase() {
private static final long serialVersionUID = -1779224307654698954L;
@Override
@@ -593,10 +593,10 @@ public class CardFactoryUtil {
* a {@link forge.card.spellability.SpellAbility} object.
* @param card
* a {@link forge.Card} object.
* @return a {@link forge.control.input.Input} object.
* @return a {@link forge.control.input.InputBase} object.
*/
public static Input modularInput(final SpellAbility ability, final Card card) {
final Input modularInput = new Input() {
public static InputBase modularInput(final SpellAbility ability, final Card card) {
final InputBase modularInput = new InputBase() {
private static final long serialVersionUID = 2322926875771867901L;
@@ -2302,10 +2302,10 @@ public class CardFactoryUtil {
* a int.
* @param type
* a {@link java.lang.String} object.
* @return a {@link forge.control.input.Input} object.
* @return a {@link forge.control.input.InputBase} object.
*/
public static Input inputUntapUpToNType(final int n, final String type) {
final Input untap = new Input() {
public static InputBase inputUntapUpToNType(final int n, final String type) {
final InputBase untap = new InputBase() {
private static final long serialVersionUID = -2167059918040912025L;
private final int stop = n;
@@ -3155,7 +3155,7 @@ public class CardFactoryUtil {
private static final long serialVersionUID = 1981791992623774490L;
@Override
protected Input onDone() {
protected InputBase onDone() {
haunterDiesWork.setTargetCard(selected.get(0));
Singletons.getModel().getGame().getStack().add(haunterDiesWork);
return null;

View File

@@ -30,7 +30,7 @@ import forge.FThreads;
import forge.Singletons;
import forge.card.ability.AbilityUtils;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.GameState;
import forge.game.player.AIPlayer;
import forge.game.player.Player;
@@ -339,7 +339,7 @@ public class CostDiscard extends CostPartWithList {
}
CountDownLatch cdl = new CountDownLatch(1);
final Input inp = new InputPayCostDiscard(cdl, ability, handList, this, payment, c, discardType);
final InputBase inp = new InputPayCostDiscard(cdl, ability, handList, this, payment, c, discardType);
FThreads.setInputAndWait(inp, cdl);
}
}

View File

@@ -30,7 +30,7 @@ import forge.Singletons;
import forge.card.ability.AbilityUtils;
import forge.card.spellability.SpellAbility;
import forge.card.spellability.SpellAbilityStackInstance;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.GameState;
import forge.game.ai.ComputerUtil;
import forge.game.player.AIPlayer;
@@ -578,7 +578,7 @@ public class CostExile extends CostPartWithList {
final CountDownLatch cdl = new CountDownLatch(1);
Input target = null;
InputBase target = null;
if (this.payCostFromSource()) {
target = new InputExileThis(cdl, payment, this, ability);
} else if (this.from.equals(ZoneType.Battlefield) || this.from.equals(ZoneType.Hand)) {

View File

@@ -25,7 +25,7 @@ import forge.Card;
import forge.FThreads;
import forge.card.ability.AbilityUtils;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.control.input.InputPayManaOfCostPayment;
import forge.control.input.InputPayManaX;
import forge.game.GameState;
@@ -219,7 +219,7 @@ public class CostPartMana extends CostPart {
}
CountDownLatch cdl = new CountDownLatch(1);
final Input inp;
final InputBase inp;
if (!"0".equals(this.getManaToPay()) || manaToAdd > 0) {
inp = new InputPayManaOfCostPayment(game, this, ability, payment, manaToAdd, cdl);

View File

@@ -27,7 +27,7 @@ import forge.CounterType;
import forge.FThreads;
import forge.card.ability.AbilityUtils;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.GameState;
import forge.game.player.AIPlayer;
import forge.game.player.Player;
@@ -380,7 +380,7 @@ public class CostRemoveCounter extends CostPartWithList {
}
}
final Input inp;
final InputBase inp;
CountDownLatch cdl = new CountDownLatch(1);
if (this.getZone().equals(ZoneType.Battlefield)) {
inp = new InputPayCostRemoveCounterType(cdl, payment, c, ability, this.getType(), this);

View File

@@ -27,7 +27,7 @@ import forge.FThreads;
import forge.Singletons;
import forge.card.ability.AbilityUtils;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.GameState;
import forge.game.ai.ComputerUtil;
import forge.game.player.AIPlayer;
@@ -47,7 +47,7 @@ public class CostReturn extends CostPartWithList {
* TODO: Write javadoc for this type.
*
*/
public static final class InputPayReturnType extends Input {
public static final class InputPayReturnType extends InputBase {
private final SpellAbility sa;
private final CostReturn part;
private final int nNeeded;
@@ -253,8 +253,8 @@ public class CostReturn extends CostPartWithList {
}
} else {
CountDownLatch cdl = new CountDownLatch(1);
final Input target = new InputPayReturnType(cdl, ability, this, c, this.getType(), payment);
final Input inp = target;
final InputBase target = new InputPayReturnType(cdl, ability, this, c, this.getType(), payment);
final InputBase inp = target;
FThreads.setInputAndWait(inp, cdl);
}

View File

@@ -27,7 +27,7 @@ import forge.FThreads;
import forge.Singletons;
import forge.card.ability.AbilityUtils;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.GameState;
import forge.game.player.AIPlayer;
import forge.game.player.Player;
@@ -47,7 +47,7 @@ public class CostReveal extends CostPartWithList {
* TODO: Write javadoc for this type.
*
*/
public static final class InputPayReveal extends Input {
public static final class InputPayReveal extends InputBase {
private final CostReveal part;
private final String discType;
private final List<Card> handList;
@@ -279,7 +279,7 @@ public class CostReveal extends CostPartWithList {
}
if (num > 0) {
final CountDownLatch cdl = new CountDownLatch(1);
final Input inp = new InputPayReveal(cdl, this, this.getType(), handList, ability, payment, num);;
final InputBase inp = new InputPayReveal(cdl, this, this.getType(), handList, ability, payment, num);;
FThreads.setInputAndWait(inp, cdl);
}
}

View File

@@ -28,7 +28,7 @@ import forge.FThreads;
import forge.Singletons;
import forge.card.ability.AbilityUtils;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.GameState;
import forge.game.ai.ComputerUtil;
import forge.game.player.AIPlayer;
@@ -47,7 +47,7 @@ public class CostTapType extends CostPartWithList {
* TODO: Write javadoc for this type.
*
*/
public static final class InputPayCostTapType extends Input {
public static final class InputPayCostTapType extends InputBase {
private final CostTapType tapType;
private final int nCards;
private final List<Card> cardList;

View File

@@ -2,13 +2,13 @@ package forge.card.cost;
import java.util.concurrent.CountDownLatch;
import forge.control.input.Input;
import forge.control.input.InputBase;
/**
* TODO: Write javadoc for this type.
*
*/
abstract class InputPayCostBase extends Input {
abstract class InputPayCostBase extends InputBase {
private static final long serialVersionUID = -2967434867139585579L;
private final CountDownLatch cdlDone;

View File

@@ -30,7 +30,7 @@ import forge.FThreads;
import forge.Singletons;
import forge.card.ability.AbilityUtils;
import forge.card.ability.ApiType;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.player.Player;
import forge.game.zone.ZoneType;
import forge.gui.GuiChoose;
@@ -50,7 +50,7 @@ public class TargetSelection {
* TODO: Write javadoc for this type.
*
*/
public final class InputSelectTargets extends Input {
public final class InputSelectTargets extends InputBase {
private final TargetSelection select;
private final List<Card> choices;
private final ArrayList<Object> alreadyTargeted;
@@ -525,7 +525,7 @@ public class TargetSelection {
if (zone.contains(ZoneType.Battlefield) && zone.size() == 1) {
CountDownLatch cdl = new CountDownLatch(1);
Input inp = new InputSelectTargets(cdl, this, choices, objects, true, this.target, this.ability, mandatory);
InputBase inp = new InputSelectTargets(cdl, this, choices, objects, true, this.target, this.ability, mandatory);
FThreads.setInputAndWait(inp, cdl);
bTargetingDone = !bCancel;
} else {

View File

@@ -42,7 +42,7 @@ import forge.view.ButtonUtil;
* @author Forge
* @version $Id$
*/
public class InputAttack extends Input {
public class InputAttack extends InputBase {
/** Constant <code>serialVersionUID=7849903731842214245L</code>. */
private static final long serialVersionUID = 7849903731842214245L;

View File

@@ -30,7 +30,7 @@ import forge.gui.match.CMatchUI;
* @author Forge
* @version $Id$
*/
public abstract class Input implements java.io.Serializable {
public abstract class InputBase implements java.io.Serializable {
/** Constant <code>serialVersionUID=-6539552513871194081L</code>. */
private static final long serialVersionUID = -6539552513871194081L;
@@ -41,9 +41,13 @@ public abstract class Input implements java.io.Serializable {
* </p>
*/
public void showMessage() {
CMatchUI.SINGLETON_INSTANCE.showMessage("Blank Input");
showMessage("Blank Input");
}
protected void showMessage(String message) {
CMatchUI.SINGLETON_INSTANCE.showMessage(message);
}
/**
* <p>
* selectCard.
@@ -104,9 +108,9 @@ public abstract class Input implements java.io.Serializable {
* </p>
*
* @param in
* a {@link forge.control.input.Input} object.
* a {@link forge.control.input.InputBase} object.
*/
public final void stopSetNext(final Input in) {
public final void stopSetNext(final InputBase in) {
this.stop();
Singletons.getModel().getMatch().getInput().setInput(in);
}

View File

@@ -42,7 +42,7 @@ import forge.view.ButtonUtil;
* @author Forge
* @version $Id$
*/
public class InputBlock extends Input {
public class InputBlock extends InputBase {
/** Constant <code>serialVersionUID=6120743598368928128L</code>. */
private static final long serialVersionUID = 6120743598368928128L;

View File

@@ -34,7 +34,7 @@ import forge.view.ButtonUtil;
* @author Forge
* @version $Id$
*/
public class InputCleanup extends Input {
public class InputCleanup extends InputBase {
/** Constant <code>serialVersionUID=-4164275418971547948L</code>. */
private static final long serialVersionUID = -4164275418971547948L;
private final GameState game;

View File

@@ -40,7 +40,7 @@ public class InputControl extends MyObservable implements java.io.Serializable {
/** Constant <code>serialVersionUID=3955194449319994301L</code>. */
private static final long serialVersionUID = 3955194449319994301L;
private final Stack<Input> inputStack = new Stack<Input>();
private final Stack<InputBase> inputStack = new Stack<InputBase>();
/**
* <p>
@@ -48,9 +48,9 @@ public class InputControl extends MyObservable implements java.io.Serializable {
* </p>
*
* @param in
* a {@link forge.control.input.Input} object.
* a {@link forge.control.input.InputBase} object.
*/
public final void setInput(final Input in) {
public final void setInput(final InputBase in) {
//System.out.println(in.getClass().getName());
this.inputStack.push(in);
// System.out.print("Current: " + input + "; Stack = " + inputStack);
@@ -63,11 +63,11 @@ public class InputControl extends MyObservable implements java.io.Serializable {
* </p>
*
* @param in
* a {@link forge.control.input.Input} object.
* a {@link forge.control.input.InputBase} object.
* @param bAddToResolving
* a boolean.
*/
public final void setInputInterrupt(final Input in) {
public final void setInputInterrupt(final InputBase in) {
// Make this
this.inputStack.push(in);
this.updateObservers();
@@ -78,9 +78,9 @@ public class InputControl extends MyObservable implements java.io.Serializable {
* Getter for the field <code>input</code>.
* </p>
*
* @return a {@link forge.control.input.Input} object.
* @return a {@link forge.control.input.InputBase} object.
*/
public final Input getInput() {
public final InputBase getInput() {
return this.inputStack.peek();
}
@@ -113,9 +113,9 @@ public class InputControl extends MyObservable implements java.io.Serializable {
* updateInput.
* </p>
*
* @return a {@link forge.control.input.Input} object.
* @return a {@link forge.control.input.InputBase} object.
*/
public final Input getActualInput(GameState game) {
public final InputBase getActualInput(GameState game) {
if ( !game.hasMulliganned() )
return new InputMulligan();
@@ -197,7 +197,7 @@ public class InputControl extends MyObservable implements java.io.Serializable {
public final void setNewInput(GameState game) {
PhaseHandler ph = game.getPhaseHandler();
final Input tmp = getActualInput(game);
final InputBase tmp = getActualInput(game);
String message = String.format("%s's %s, priority of %s [%sP] input is %s \t stack:%s", ph.getPlayerTurn(), ph.getPhase(), ph.getPriorityPlayer(), ph.isPlayerPriorityAllowed() ? "+" : "-", tmp == null ? "null" : tmp.getClass().getSimpleName(), inputStack);
System.out.println(message);

View File

@@ -7,7 +7,7 @@ import forge.view.ButtonUtil;
* TODO: Write javadoc for this type.
*
*/
public class InputLockUI extends Input {
public class InputLockUI extends InputBase {
private static final long serialVersionUID = 5777143577098597374L;
public void showMessage() {

View File

@@ -49,7 +49,7 @@ import forge.view.ButtonUtil;
* @author Forge
* @version $Id$
*/
public class InputMulligan extends Input {
public class InputMulligan extends InputBase {
/** Constant <code>serialVersionUID=-8112954303001155622L</code>. */
private static final long serialVersionUID = -8112954303001155622L;

View File

@@ -38,7 +38,7 @@ import forge.view.ButtonUtil;
* @author Forge
* @version $Id$
*/
public class InputPassPriority extends Input {
public class InputPassPriority extends InputBase {
/** Constant <code>serialVersionUID=-581477682214137181L</code>. */
private static final long serialVersionUID = -581477682214137181L;

View File

@@ -42,7 +42,7 @@ import forge.view.ButtonUtil;
* @author Forge
* @version $Id: InputPayManaCostAbility.java 15673 2012-05-23 14:01:35Z ArsenalNut $
*/
public class InputPayDiscardCostWithCommands extends Input implements InputPayment {
public class InputPayDiscardCostWithCommands extends InputBase implements InputPayment {
/**
* Constant <code>serialVersionUID=2685832214529141991L</code>.
*/

View File

@@ -28,7 +28,7 @@ import forge.gui.match.views.VMessage;
* TODO: Write javadoc for this type.
*
*/
public abstract class InputPayManaBase extends Input {
public abstract class InputPayManaBase extends InputBase {
private static final long serialVersionUID = -9133423708688480255L;

View File

@@ -72,7 +72,7 @@ public class InputPayManaOfCostPayment extends InputPayManaBase {
payment.setPaidPart(costMana);
} else {
source.setXManaCostPaid(0);
final Input inp = new InputPayManaX(game, saPaidFor, payment, costMana, cdlFinished);
final InputBase inp = new InputPayManaX(game, saPaidFor, payment, costMana, cdlFinished);
Singletons.getModel().getMatch().getInput().setInputInterrupt(inp);
}

View File

@@ -41,7 +41,7 @@ import forge.view.ButtonUtil;
* @author Forge
* @version $Id: InputPayManaCostAbility.java 15673 2012-05-23 14:01:35Z ArsenalNut $
*/
public class InputPayReturnCost extends Input implements InputPayment {
public class InputPayReturnCost extends InputBase implements InputPayment {
/**
* Constant <code>serialVersionUID=2685832214529141991L</code>.
*/

View File

@@ -42,7 +42,7 @@ import forge.view.ButtonUtil;
* @author Forge
* @version $Id: InputPayManaCostAbility.java 15673 2012-05-23 14:01:35Z ArsenalNut $
*/
public class InputPaySacCost extends Input {
public class InputPaySacCost extends InputBase {
/**
* Constant <code>serialVersionUID=2685832214529141991L</code>.
*/

View File

@@ -11,7 +11,7 @@ import forge.view.ButtonUtil;
* TODO: Write javadoc for this type.
*
*/
public abstract class InputSelectMany<T extends GameEntity> extends Input {
public abstract class InputSelectMany<T extends GameEntity> extends InputBase {
private static final long serialVersionUID = -2305549394512889450L;
@@ -66,7 +66,7 @@ public abstract class InputSelectMany<T extends GameEntity> extends Input {
@Override
public final void selectButtonCancel() {
// this.stop();
Input next = onCancel(); // might add ability to stack from here
InputBase next = onCancel(); // might add ability to stack from here
// if ( next != null ) {
// Singletons.getModel().getMatch().getInput().setInput(next);
// }
@@ -88,7 +88,7 @@ public abstract class InputSelectMany<T extends GameEntity> extends Input {
// if it does, uncomment the 5 lines below, use them as method body
// this.stop();
Input next = onDone(); // might add ability to stack from here
InputBase next = onDone(); // might add ability to stack from here
// if ( next != null ) {
// Singletons.getModel().getMatch().getInput().setInput(next);
// }
@@ -112,11 +112,11 @@ public abstract class InputSelectMany<T extends GameEntity> extends Input {
}
// must define these
protected abstract Input onDone();
protected abstract InputBase onDone();
protected abstract boolean isValidChoice(T choice);
// might re-define later
protected Input onCancel() { return null; }
protected InputBase onCancel() { return null; }
protected boolean canCancelWithSomethingSelected() { return false; }
protected boolean hasEnoughTargets() { return selected.size() >= min; }
protected boolean hasAllTargets() { return selected.size() >= max; }

View File

@@ -10,10 +10,10 @@ import forge.game.player.Player;
public class InputSelectManyPlayers extends InputSelectMany<Player> {
private static final long serialVersionUID = -8209690791522735L;
protected final Function<List<Player>, Input> onComplete;
protected final Function<List<Player>, InputBase> onComplete;
private final Predicate<Player> allowedFilter;
public InputSelectManyPlayers(final Predicate<Player> allowedRule, int min, int max, final Function<List<Player>, Input> onDone) {
public InputSelectManyPlayers(final Predicate<Player> allowedRule, int min, int max, final Function<List<Player>, InputBase> onDone) {
super(min, max);
allowedFilter = allowedRule;
@@ -34,7 +34,7 @@ public class InputSelectManyPlayers extends InputSelectMany<Player> {
}
@Override
protected Input onDone() {
protected InputBase onDone() {
return onComplete.apply(selected);
}
}

View File

@@ -59,7 +59,7 @@ import forge.card.spellability.AbilityManaPart;
import forge.card.spellability.AbilitySub;
import forge.card.spellability.SpellAbility;
import forge.card.spellability.SpellAbilityRestriction;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.control.input.InputPayDiscardCostWithCommands;
import forge.control.input.InputPayManaExecuteCommands;
import forge.control.input.InputPayReturnCost;
@@ -577,7 +577,7 @@ public final class GameActionUtil {
//the following costs need inputs and can't be combined at the moment
Input toSet = null;
InputBase toSet = null;
CountDownLatch cdl = new CountDownLatch(1);
if (costPart instanceof CostReturn) {
toSet = new InputPayReturnCost((CostReturn) costPart, ability, cdl);

View File

@@ -3,7 +3,7 @@ package forge.game.ai;
import java.util.List;
import forge.Card;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.GameState;
import forge.game.phase.CombatUtil;
import forge.game.player.Player;
@@ -12,7 +12,7 @@ import forge.game.player.Player;
* TODO: Write javadoc for this type.
*
*/
public class AiInputBlock extends Input {
public class AiInputBlock extends InputBase {
private final GameState game;
/**

View File

@@ -18,7 +18,7 @@
package forge.game.ai;
import forge.FThreads;
import forge.control.input.Input;
import forge.control.input.InputBase;
/**
* <p>
@@ -28,7 +28,7 @@ import forge.control.input.Input;
* @author Forge
* @version $Id$
*/
public class AiInputCommon extends Input {
public class AiInputCommon extends InputBase {
/** Constant <code>serialVersionUID=-3091338639571662216L</code>. */
private static final long serialVersionUID = -3091338639571662216L;

View File

@@ -30,7 +30,7 @@ import forge.CardPredicates.Presets;
import forge.CounterType;
import forge.GameEntity;
import forge.Singletons;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.GameState;
import forge.game.ai.ComputerUtilCard;
import forge.game.player.Player;
@@ -210,7 +210,7 @@ public class Untap extends Phase {
landList.get(0).untap();
}
} else {
final Input target = new Input() {
final InputBase target = new InputBase() {
private static final long serialVersionUID = 6653677835629939465L;
@Override
@@ -250,7 +250,7 @@ public class Untap extends Phase {
ComputerUtilCard.getBestArtifactAI(artList).untap();
}
} else {
final Input target = new Input() {
final InputBase target = new InputBase() {
private static final long serialVersionUID = 5555427219659889707L;
@Override
@@ -290,7 +290,7 @@ public class Untap extends Phase {
creatures.get(0).untap();
}
} else {
final Input target = new Input() {
final InputBase target = new InputBase() {
private static final long serialVersionUID = 5555427219659889707L;
@Override

View File

@@ -41,7 +41,7 @@ import forge.card.spellability.Ability;
import forge.card.spellability.AbilityManaPart;
import forge.card.spellability.AbilityStatic;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.control.input.InputPayManaExecuteCommands;
import forge.control.input.InputSelectManyCards;
import forge.game.GameActionUtil;
@@ -464,7 +464,7 @@ public class Upkeep extends Phase {
@Override
public void resolve() {
final List<Card> targets = CardLists.getTargetableCards(abyssGetTargets, this);
final Input chooseArt = new InputSelectManyCards(1, 1) {
final InputBase chooseArt = new InputSelectManyCards(1, 1) {
private static final long serialVersionUID = 4820011040853968644L;
@Override
@@ -478,7 +478,7 @@ public class Upkeep extends Phase {
};
@Override
protected Input onDone() {
protected InputBase onDone() {
game.getAction().destroyNoRegeneration(selected.get(0));
return null;
}
@@ -1034,7 +1034,7 @@ public class Upkeep extends Phase {
list.remove(toTap);
}
} else {
Singletons.getModel().getMatch().getInput().setInput(new Input() {
Singletons.getModel().getMatch().getInput().setInput(new InputBase() {
private static final long serialVersionUID = 5313424586016061612L;
@Override

View File

@@ -8,7 +8,7 @@ import org.apache.commons.lang3.tuple.ImmutablePair;
import forge.Card;
import forge.GameEntity;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.deck.Deck;
import forge.game.GameState;
import forge.game.GameType;
@@ -32,9 +32,9 @@ public abstract class PlayerController {
public PlayerController(GameState game0) {
game = game0;
}
public abstract Input getDefaultInput();
public abstract Input getBlockInput();
public abstract Input getCleanupInput();
public abstract InputBase getDefaultInput();
public abstract InputBase getBlockInput();
public abstract InputBase getCleanupInput();
/**

View File

@@ -11,7 +11,7 @@ import forge.Card;
import forge.GameEntity;
import forge.card.spellability.Spell;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.deck.Deck;
import forge.game.GameState;
import forge.game.GameType;
@@ -32,15 +32,15 @@ import forge.gui.GuiChoose;
*/
public class PlayerControllerAi extends PlayerController {
private Input defaultInput;
private Input blockInput;
private Input cleanupInput;
private InputBase defaultInput;
private InputBase blockInput;
private InputBase cleanupInput;
private final AiController brains;
private final AIPlayer player;
public final Input getDefaultInput() {
public final InputBase getDefaultInput() {
return defaultInput;
}
@@ -70,14 +70,14 @@ public class PlayerControllerAi extends PlayerController {
}
/** Input to use when player has to declare blockers */
public Input getBlockInput() {
public InputBase getBlockInput() {
return blockInput;
}
/**
* @return the cleanupInput
*/
public Input getCleanupInput() {
public InputBase getCleanupInput() {
return cleanupInput;
}

View File

@@ -13,7 +13,7 @@ import org.apache.commons.lang3.tuple.ImmutablePair;
import forge.Card;
import forge.GameEntity;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.control.input.InputBlock;
import forge.control.input.InputCleanup;
import forge.control.input.InputPassPriority;
@@ -38,12 +38,12 @@ import forge.item.CardPrinted;
*/
public class PlayerControllerHuman extends PlayerController {
private final Input defaultInput;
private final Input blockInput;
private final Input cleanupInput;
private final InputBase defaultInput;
private final InputBase blockInput;
private final InputBase cleanupInput;
private final HumanPlayer player;
public final Input getDefaultInput() {
public final InputBase getDefaultInput() {
return defaultInput;
}
@@ -75,14 +75,14 @@ public class PlayerControllerHuman extends PlayerController {
}
/** Input to use when player has to declare blockers */
public Input getBlockInput() {
public InputBase getBlockInput() {
return blockInput;
}
/**
* @return the cleanupInput
*/
public Input getCleanupInput() {
public InputBase getCleanupInput() {
return cleanupInput;
}

View File

@@ -23,7 +23,7 @@ import forge.Card;
import forge.CardLists;
import forge.Singletons;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.zone.Zone;
import forge.game.zone.ZoneType;
import forge.gui.match.CMatchUI;
@@ -54,12 +54,12 @@ public final class PlayerUtil {
* a {@link java.lang.String} object.
* @param sa
* a {@link forge.card.spellability.SpellAbility} object.
* @return a {@link forge.control.input.Input} object.
* @return a {@link forge.control.input.InputBase} object.
* @since 1.0.15
*/
public static Input inputDiscardNumUnless(final int nCards, final String uType, final SpellAbility sa) {
public static InputBase inputDiscardNumUnless(final int nCards, final String uType, final SpellAbility sa) {
final SpellAbility sp = sa;
final Input target = new Input() {
final InputBase target = new InputBase() {
private static final long serialVersionUID = 8822292413831640944L;
private int n = 0;
@@ -111,12 +111,12 @@ public final class PlayerUtil {
* a int.
* @param sa
* a {@link forge.card.spellability.SpellAbility} object.
* @return a {@link forge.control.input.Input} object.
* @return a {@link forge.control.input.InputBase} object.
* @since 1.0.15
*/
public static Input inputDiscard(final int nCards, final SpellAbility sa) {
public static InputBase inputDiscard(final int nCards, final SpellAbility sa) {
final SpellAbility sp = sa;
final Input target = new Input() {
final InputBase target = new InputBase() {
private static final long serialVersionUID = -329993322080934435L;
private int n = 0;
@@ -162,10 +162,10 @@ public final class PlayerUtil {
* a int.
* @param type
* a {@link java.lang.String} object.
* @return a {@link forge.control.input.Input} object.
* @return a {@link forge.control.input.InputBase} object.
* @since 1.0.15
*/
public static Input inputSacrificePermanents(final int nCards, final String type) {
public static InputBase inputSacrificePermanents(final int nCards, final String type) {
final List<Card> list = CardLists.getType(Singletons.getControl().getPlayer().getCardsIn(ZoneType.Battlefield), type);
return PlayerUtil.inputSacrificePermanentsFromList(nCards, list, "Select a " + type + " to sacrifice");
@@ -182,11 +182,11 @@ public final class PlayerUtil {
* a {@link forge.CardList} object.
* @param message
* a {@link java.lang.String} object.
* @return a {@link forge.control.input.Input} object.
* @return a {@link forge.control.input.InputBase} object.
* @since 1.0.15
*/
public static Input inputSacrificePermanentsFromList(final int nCards, final List<Card> list, final String message) {
final Input target = new Input() {
public static InputBase inputSacrificePermanentsFromList(final int nCards, final List<Card> list, final String message) {
final InputBase target = new InputBase() {
private static final long serialVersionUID = 1981791992623774490L;
private int n = 0;

View File

@@ -49,7 +49,7 @@ import forge.card.spellability.TargetChoices;
import forge.card.spellability.TargetSelection;
import forge.card.trigger.Trigger;
import forge.card.trigger.TriggerType;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.control.input.InputPayManaExecuteCommands;
import forge.game.GameActionUtil;
import forge.game.GameState;
@@ -859,7 +859,7 @@ public class MagicStack extends MyObservable {
if (creats.size() != 0) {
haunterDiesWork.setDescription("");
final Input target = new Input() {
final InputBase target = new InputBase() {
private static final long serialVersionUID = 1981791992623774490L;
@Override

View File

@@ -23,7 +23,7 @@ import java.util.Observer;
import forge.Card;
import forge.FThreads;
import forge.Singletons;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.game.player.Player;
import forge.view.ButtonUtil;
@@ -38,7 +38,7 @@ import forge.view.ButtonUtil;
public class InputProxy implements Observer {
/** The input. */
private Input input;
private InputBase input;
private boolean valid = false;
@Override
@@ -54,9 +54,9 @@ public class InputProxy implements Observer {
* </p>
*
* @param in
* a {@link forge.control.input.Input} object.
* a {@link forge.control.input.InputBase} object.
*/
public final synchronized void setInput(final Input in) {
public final synchronized void setInput(final InputBase in) {
valid = true;
this.input = in;
@@ -122,8 +122,8 @@ public class InputProxy implements Observer {
return this.getInput().toString();
}
/** @return {@link forge.gui.InputProxy.Input} */
public Input getInput() {
/** @return {@link forge.gui.InputProxy.InputBase} */
public InputBase getInput() {
return this.input;
}

View File

@@ -37,7 +37,7 @@ import forge.Singletons;
import forge.card.cardfactory.CardFactory;
import forge.card.cardfactory.CardFactoryUtil;
import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputBase;
import forge.control.input.InputAttack;
import forge.control.input.InputBlock;
import forge.control.input.InputPayManaBase;
@@ -388,7 +388,7 @@ public class CField implements ICDoc {
// Roujin's bug fix version dated 2-12-2012
final Card c = CField.this.view.getTabletop().getHoveredCard(e);
final Input input = CMessage.SINGLETON_INSTANCE.getInputControl().getInput();
final InputBase input = CMessage.SINGLETON_INSTANCE.getInputControl().getInput();
if (c != null && c.isInZone(ZoneType.Battlefield)) {
if (c.isTapped() && (input instanceof InputPayManaSimple || input instanceof InputPayManaExecuteCommands)) {
@@ -443,7 +443,7 @@ public class CField implements ICDoc {
/** */
private void manaAction(String constantColor) {
if (CField.this.player == CField.this.playerViewer) {
final Input in = Singletons.getModel().getMatch().getInput().getInput();
final InputBase in = Singletons.getModel().getMatch().getInput().getInput();
if (in instanceof InputPayManaBase) {
// Do something
((InputPayManaBase) in).selectManaPool(constantColor);