mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Inputs base class renamed
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -13796,8 +13796,8 @@ src/main/java/forge/control/Lobby.java -text
|
|||||||
src/main/java/forge/control/RestartUtil.java -text
|
src/main/java/forge/control/RestartUtil.java -text
|
||||||
src/main/java/forge/control/bazaar/ControlStall.java -text
|
src/main/java/forge/control/bazaar/ControlStall.java -text
|
||||||
src/main/java/forge/control/bazaar/package-info.java svneol=native#text/plain
|
src/main/java/forge/control/bazaar/package-info.java svneol=native#text/plain
|
||||||
src/main/java/forge/control/input/Input.java svneol=native#text/plain
|
|
||||||
src/main/java/forge/control/input/InputAttack.java svneol=native#text/plain
|
src/main/java/forge/control/input/InputAttack.java svneol=native#text/plain
|
||||||
|
src/main/java/forge/control/input/InputBase.java svneol=native#text/plain
|
||||||
src/main/java/forge/control/input/InputBlock.java svneol=native#text/plain
|
src/main/java/forge/control/input/InputBlock.java svneol=native#text/plain
|
||||||
src/main/java/forge/control/input/InputCleanup.java svneol=native#text/plain
|
src/main/java/forge/control/input/InputCleanup.java svneol=native#text/plain
|
||||||
src/main/java/forge/control/input/InputControl.java svneol=native#text/plain
|
src/main/java/forge/control/input/InputControl.java svneol=native#text/plain
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import java.util.concurrent.Executors;
|
|||||||
|
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.error.BugReporter;
|
import forge.error.BugReporter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -105,7 +105,7 @@ public class FThreads {
|
|||||||
invokeInNewThread(toRun);
|
invokeInNewThread(toRun);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final void setInputAndWait(Input inp, CountDownLatch cdl) {
|
public static final void setInputAndWait(InputBase inp, CountDownLatch cdl) {
|
||||||
checkEDT("FThreads.setInputAndWait", false);
|
checkEDT("FThreads.setInputAndWait", false);
|
||||||
Singletons.getModel().getMatch().getInput().setInputInterrupt(inp);
|
Singletons.getModel().getMatch().getInput().setInputInterrupt(inp);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import forge.Singletons;
|
|||||||
import forge.card.ability.SpellAbilityEffect;
|
import forge.card.ability.SpellAbilityEffect;
|
||||||
import forge.card.cardfactory.CardFactoryUtil;
|
import forge.card.cardfactory.CardFactoryUtil;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
import forge.gui.GuiChoose;
|
import forge.gui.GuiChoose;
|
||||||
@@ -45,7 +45,7 @@ public class CountersProliferateEffect extends SpellAbilityEffect {
|
|||||||
private static void resolveHuman(final SpellAbility sa) {
|
private static void resolveHuman(final SpellAbility sa) {
|
||||||
final List<Card> unchosen = Lists.newArrayList(Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield));
|
final List<Card> unchosen = Lists.newArrayList(Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield));
|
||||||
final List<Player> players = new ArrayList<Player>(Singletons.getModel().getGame().getPlayers());
|
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;
|
private static final long serialVersionUID = -1779224307654698954L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import forge.card.spellability.SpellPermanent;
|
|||||||
import forge.card.spellability.Target;
|
import forge.card.spellability.Target;
|
||||||
import forge.card.trigger.Trigger;
|
import forge.card.trigger.Trigger;
|
||||||
import forge.card.trigger.TriggerHandler;
|
import forge.card.trigger.TriggerHandler;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.control.input.InputSelectManyCards;
|
import forge.control.input.InputSelectManyCards;
|
||||||
import forge.game.ai.ComputerUtilCard;
|
import forge.game.ai.ComputerUtilCard;
|
||||||
import forge.game.ai.ComputerUtilCombat;
|
import forge.game.ai.ComputerUtilCombat;
|
||||||
@@ -477,7 +477,7 @@ public class CardFactoryCreatures {
|
|||||||
private static void getCard_PhyrexianDreadnought(final Card card, final String cardName) {
|
private static void getCard_PhyrexianDreadnought(final Card card, final String cardName) {
|
||||||
final Player player = card.getController();
|
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;
|
private static final long serialVersionUID = 2698036349873486664L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -495,7 +495,7 @@ public class CardFactoryCreatures {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Input onCancel() {
|
protected InputBase onCancel() {
|
||||||
Singletons.getModel().getGame().getAction().sacrifice(card, null);
|
Singletons.getModel().getGame().getAction().sacrifice(card, null);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -507,7 +507,7 @@ public class CardFactoryCreatures {
|
|||||||
} // selectCard()
|
} // selectCard()
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Input onDone() {
|
protected InputBase onDone() {
|
||||||
for (final Card sac : selected) {
|
for (final Card sac : selected) {
|
||||||
Singletons.getModel().getGame().getAction().sacrifice(sac, null);
|
Singletons.getModel().getGame().getAction().sacrifice(sac, null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import forge.Card;
|
|||||||
import forge.CardLists;
|
import forge.CardLists;
|
||||||
import forge.Command;
|
import forge.Command;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.control.input.InputSelectManyCards;
|
import forge.control.input.InputSelectManyCards;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.zone.Zone;
|
import forge.game.zone.Zone;
|
||||||
@@ -76,7 +76,7 @@ class CardFactoryLands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Input onDone() {
|
protected InputBase onDone() {
|
||||||
if (selected.isEmpty()) {
|
if (selected.isEmpty()) {
|
||||||
return onCancel();
|
return onCancel();
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ class CardFactoryLands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Input onCancel() {
|
public InputBase onCancel() {
|
||||||
card.setTapped(true);
|
card.setTapped(true);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ import forge.card.spellability.Target;
|
|||||||
import forge.card.trigger.Trigger;
|
import forge.card.trigger.Trigger;
|
||||||
import forge.card.trigger.TriggerHandler;
|
import forge.card.trigger.TriggerHandler;
|
||||||
import forge.card.trigger.TriggerType;
|
import forge.card.trigger.TriggerType;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.control.input.InputSelectManyCards;
|
import forge.control.input.InputSelectManyCards;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.ai.ComputerUtil;
|
import forge.game.ai.ComputerUtil;
|
||||||
@@ -98,10 +98,10 @@ public class CardFactoryUtil {
|
|||||||
* a {@link forge.CardList} object.
|
* a {@link forge.CardList} object.
|
||||||
* @param message
|
* @param message
|
||||||
* a {@link java.lang.String} object.
|
* 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) {
|
public static InputBase inputDestroyNoRegeneration(final List<Card> choices, final String message) {
|
||||||
final Input target = new Input() {
|
final InputBase target = new InputBase() {
|
||||||
private static final long serialVersionUID = -6637588517573573232L;
|
private static final long serialVersionUID = -6637588517573573232L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -549,11 +549,11 @@ public class CardFactoryUtil {
|
|||||||
* a {@link forge.CardList} object.
|
* a {@link forge.CardList} object.
|
||||||
* @param paid
|
* @param paid
|
||||||
* a {@link forge.Command} object.
|
* 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 Command paid) {
|
||||||
final Input target = new Input() {
|
final InputBase target = new InputBase() {
|
||||||
private static final long serialVersionUID = -1779224307654698954L;
|
private static final long serialVersionUID = -1779224307654698954L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -593,10 +593,10 @@ public class CardFactoryUtil {
|
|||||||
* a {@link forge.card.spellability.SpellAbility} object.
|
* a {@link forge.card.spellability.SpellAbility} object.
|
||||||
* @param card
|
* @param card
|
||||||
* a {@link forge.Card} object.
|
* 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) {
|
public static InputBase modularInput(final SpellAbility ability, final Card card) {
|
||||||
final Input modularInput = new Input() {
|
final InputBase modularInput = new InputBase() {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2322926875771867901L;
|
private static final long serialVersionUID = 2322926875771867901L;
|
||||||
|
|
||||||
@@ -2302,10 +2302,10 @@ public class CardFactoryUtil {
|
|||||||
* a int.
|
* a int.
|
||||||
* @param type
|
* @param type
|
||||||
* a {@link java.lang.String} object.
|
* 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) {
|
public static InputBase inputUntapUpToNType(final int n, final String type) {
|
||||||
final Input untap = new Input() {
|
final InputBase untap = new InputBase() {
|
||||||
private static final long serialVersionUID = -2167059918040912025L;
|
private static final long serialVersionUID = -2167059918040912025L;
|
||||||
|
|
||||||
private final int stop = n;
|
private final int stop = n;
|
||||||
@@ -3155,7 +3155,7 @@ public class CardFactoryUtil {
|
|||||||
private static final long serialVersionUID = 1981791992623774490L;
|
private static final long serialVersionUID = 1981791992623774490L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Input onDone() {
|
protected InputBase onDone() {
|
||||||
haunterDiesWork.setTargetCard(selected.get(0));
|
haunterDiesWork.setTargetCard(selected.get(0));
|
||||||
Singletons.getModel().getGame().getStack().add(haunterDiesWork);
|
Singletons.getModel().getGame().getStack().add(haunterDiesWork);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import forge.FThreads;
|
|||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.player.AIPlayer;
|
import forge.game.player.AIPlayer;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -339,7 +339,7 @@ public class CostDiscard extends CostPartWithList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CountDownLatch cdl = new CountDownLatch(1);
|
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);
|
FThreads.setInputAndWait(inp, cdl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import forge.Singletons;
|
|||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.card.spellability.SpellAbilityStackInstance;
|
import forge.card.spellability.SpellAbilityStackInstance;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.ai.ComputerUtil;
|
import forge.game.ai.ComputerUtil;
|
||||||
import forge.game.player.AIPlayer;
|
import forge.game.player.AIPlayer;
|
||||||
@@ -578,7 +578,7 @@ public class CostExile extends CostPartWithList {
|
|||||||
|
|
||||||
final CountDownLatch cdl = new CountDownLatch(1);
|
final CountDownLatch cdl = new CountDownLatch(1);
|
||||||
|
|
||||||
Input target = null;
|
InputBase target = null;
|
||||||
if (this.payCostFromSource()) {
|
if (this.payCostFromSource()) {
|
||||||
target = new InputExileThis(cdl, payment, this, ability);
|
target = new InputExileThis(cdl, payment, this, ability);
|
||||||
} else if (this.from.equals(ZoneType.Battlefield) || this.from.equals(ZoneType.Hand)) {
|
} else if (this.from.equals(ZoneType.Battlefield) || this.from.equals(ZoneType.Hand)) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import forge.Card;
|
|||||||
import forge.FThreads;
|
import forge.FThreads;
|
||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.control.input.InputPayManaOfCostPayment;
|
import forge.control.input.InputPayManaOfCostPayment;
|
||||||
import forge.control.input.InputPayManaX;
|
import forge.control.input.InputPayManaX;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
@@ -219,7 +219,7 @@ public class CostPartMana extends CostPart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CountDownLatch cdl = new CountDownLatch(1);
|
CountDownLatch cdl = new CountDownLatch(1);
|
||||||
final Input inp;
|
final InputBase inp;
|
||||||
if (!"0".equals(this.getManaToPay()) || manaToAdd > 0) {
|
if (!"0".equals(this.getManaToPay()) || manaToAdd > 0) {
|
||||||
inp = new InputPayManaOfCostPayment(game, this, ability, payment, manaToAdd, cdl);
|
inp = new InputPayManaOfCostPayment(game, this, ability, payment, manaToAdd, cdl);
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import forge.CounterType;
|
|||||||
import forge.FThreads;
|
import forge.FThreads;
|
||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.player.AIPlayer;
|
import forge.game.player.AIPlayer;
|
||||||
import forge.game.player.Player;
|
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);
|
CountDownLatch cdl = new CountDownLatch(1);
|
||||||
if (this.getZone().equals(ZoneType.Battlefield)) {
|
if (this.getZone().equals(ZoneType.Battlefield)) {
|
||||||
inp = new InputPayCostRemoveCounterType(cdl, payment, c, ability, this.getType(), this);
|
inp = new InputPayCostRemoveCounterType(cdl, payment, c, ability, this.getType(), this);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import forge.FThreads;
|
|||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.ai.ComputerUtil;
|
import forge.game.ai.ComputerUtil;
|
||||||
import forge.game.player.AIPlayer;
|
import forge.game.player.AIPlayer;
|
||||||
@@ -47,7 +47,7 @@ public class CostReturn extends CostPartWithList {
|
|||||||
* TODO: Write javadoc for this type.
|
* 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 SpellAbility sa;
|
||||||
private final CostReturn part;
|
private final CostReturn part;
|
||||||
private final int nNeeded;
|
private final int nNeeded;
|
||||||
@@ -253,8 +253,8 @@ public class CostReturn extends CostPartWithList {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CountDownLatch cdl = new CountDownLatch(1);
|
CountDownLatch cdl = new CountDownLatch(1);
|
||||||
final Input target = new InputPayReturnType(cdl, ability, this, c, this.getType(), payment);
|
final InputBase target = new InputPayReturnType(cdl, ability, this, c, this.getType(), payment);
|
||||||
final Input inp = target;
|
final InputBase inp = target;
|
||||||
FThreads.setInputAndWait(inp, cdl);
|
FThreads.setInputAndWait(inp, cdl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import forge.FThreads;
|
|||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.player.AIPlayer;
|
import forge.game.player.AIPlayer;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -47,7 +47,7 @@ public class CostReveal extends CostPartWithList {
|
|||||||
* TODO: Write javadoc for this type.
|
* 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 CostReveal part;
|
||||||
private final String discType;
|
private final String discType;
|
||||||
private final List<Card> handList;
|
private final List<Card> handList;
|
||||||
@@ -279,7 +279,7 @@ public class CostReveal extends CostPartWithList {
|
|||||||
}
|
}
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
final CountDownLatch cdl = new CountDownLatch(1);
|
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);
|
FThreads.setInputAndWait(inp, cdl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import forge.FThreads;
|
|||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.ai.ComputerUtil;
|
import forge.game.ai.ComputerUtil;
|
||||||
import forge.game.player.AIPlayer;
|
import forge.game.player.AIPlayer;
|
||||||
@@ -47,7 +47,7 @@ public class CostTapType extends CostPartWithList {
|
|||||||
* TODO: Write javadoc for this type.
|
* 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 CostTapType tapType;
|
||||||
private final int nCards;
|
private final int nCards;
|
||||||
private final List<Card> cardList;
|
private final List<Card> cardList;
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ package forge.card.cost;
|
|||||||
|
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Write javadoc for this type.
|
* TODO: Write javadoc for this type.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
abstract class InputPayCostBase extends Input {
|
abstract class InputPayCostBase extends InputBase {
|
||||||
private static final long serialVersionUID = -2967434867139585579L;
|
private static final long serialVersionUID = -2967434867139585579L;
|
||||||
|
|
||||||
private final CountDownLatch cdlDone;
|
private final CountDownLatch cdlDone;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import forge.FThreads;
|
|||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.ability.ApiType;
|
import forge.card.ability.ApiType;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
import forge.gui.GuiChoose;
|
import forge.gui.GuiChoose;
|
||||||
@@ -50,7 +50,7 @@ public class TargetSelection {
|
|||||||
* TODO: Write javadoc for this type.
|
* TODO: Write javadoc for this type.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class InputSelectTargets extends Input {
|
public final class InputSelectTargets extends InputBase {
|
||||||
private final TargetSelection select;
|
private final TargetSelection select;
|
||||||
private final List<Card> choices;
|
private final List<Card> choices;
|
||||||
private final ArrayList<Object> alreadyTargeted;
|
private final ArrayList<Object> alreadyTargeted;
|
||||||
@@ -525,7 +525,7 @@ public class TargetSelection {
|
|||||||
|
|
||||||
if (zone.contains(ZoneType.Battlefield) && zone.size() == 1) {
|
if (zone.contains(ZoneType.Battlefield) && zone.size() == 1) {
|
||||||
CountDownLatch cdl = new CountDownLatch(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);
|
FThreads.setInputAndWait(inp, cdl);
|
||||||
bTargetingDone = !bCancel;
|
bTargetingDone = !bCancel;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import forge.view.ButtonUtil;
|
|||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class InputAttack extends Input {
|
public class InputAttack extends InputBase {
|
||||||
/** Constant <code>serialVersionUID=7849903731842214245L</code>. */
|
/** Constant <code>serialVersionUID=7849903731842214245L</code>. */
|
||||||
private static final long serialVersionUID = 7849903731842214245L;
|
private static final long serialVersionUID = 7849903731842214245L;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import forge.gui.match.CMatchUI;
|
|||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public abstract class Input implements java.io.Serializable {
|
public abstract class InputBase implements java.io.Serializable {
|
||||||
/** Constant <code>serialVersionUID=-6539552513871194081L</code>. */
|
/** Constant <code>serialVersionUID=-6539552513871194081L</code>. */
|
||||||
private static final long serialVersionUID = -6539552513871194081L;
|
private static final long serialVersionUID = -6539552513871194081L;
|
||||||
|
|
||||||
@@ -41,7 +41,11 @@ public abstract class Input implements java.io.Serializable {
|
|||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
CMatchUI.SINGLETON_INSTANCE.showMessage("Blank Input");
|
showMessage("Blank Input");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void showMessage(String message) {
|
||||||
|
CMatchUI.SINGLETON_INSTANCE.showMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,9 +108,9 @@ public abstract class Input implements java.io.Serializable {
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param in
|
* @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();
|
this.stop();
|
||||||
Singletons.getModel().getMatch().getInput().setInput(in);
|
Singletons.getModel().getMatch().getInput().setInput(in);
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ import forge.view.ButtonUtil;
|
|||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class InputBlock extends Input {
|
public class InputBlock extends InputBase {
|
||||||
/** Constant <code>serialVersionUID=6120743598368928128L</code>. */
|
/** Constant <code>serialVersionUID=6120743598368928128L</code>. */
|
||||||
private static final long serialVersionUID = 6120743598368928128L;
|
private static final long serialVersionUID = 6120743598368928128L;
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import forge.view.ButtonUtil;
|
|||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class InputCleanup extends Input {
|
public class InputCleanup extends InputBase {
|
||||||
/** Constant <code>serialVersionUID=-4164275418971547948L</code>. */
|
/** Constant <code>serialVersionUID=-4164275418971547948L</code>. */
|
||||||
private static final long serialVersionUID = -4164275418971547948L;
|
private static final long serialVersionUID = -4164275418971547948L;
|
||||||
private final GameState game;
|
private final GameState game;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class InputControl extends MyObservable implements java.io.Serializable {
|
|||||||
/** Constant <code>serialVersionUID=3955194449319994301L</code>. */
|
/** Constant <code>serialVersionUID=3955194449319994301L</code>. */
|
||||||
private static final long serialVersionUID = 3955194449319994301L;
|
private static final long serialVersionUID = 3955194449319994301L;
|
||||||
|
|
||||||
private final Stack<Input> inputStack = new Stack<Input>();
|
private final Stack<InputBase> inputStack = new Stack<InputBase>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -48,9 +48,9 @@ public class InputControl extends MyObservable implements java.io.Serializable {
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param in
|
* @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());
|
//System.out.println(in.getClass().getName());
|
||||||
this.inputStack.push(in);
|
this.inputStack.push(in);
|
||||||
// System.out.print("Current: " + input + "; Stack = " + inputStack);
|
// System.out.print("Current: " + input + "; Stack = " + inputStack);
|
||||||
@@ -63,11 +63,11 @@ public class InputControl extends MyObservable implements java.io.Serializable {
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param in
|
* @param in
|
||||||
* a {@link forge.control.input.Input} object.
|
* a {@link forge.control.input.InputBase} object.
|
||||||
* @param bAddToResolving
|
* @param bAddToResolving
|
||||||
* a boolean.
|
* a boolean.
|
||||||
*/
|
*/
|
||||||
public final void setInputInterrupt(final Input in) {
|
public final void setInputInterrupt(final InputBase in) {
|
||||||
// Make this
|
// Make this
|
||||||
this.inputStack.push(in);
|
this.inputStack.push(in);
|
||||||
this.updateObservers();
|
this.updateObservers();
|
||||||
@@ -78,9 +78,9 @@ public class InputControl extends MyObservable implements java.io.Serializable {
|
|||||||
* Getter for the field <code>input</code>.
|
* Getter for the field <code>input</code>.
|
||||||
* </p>
|
* </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();
|
return this.inputStack.peek();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,9 +113,9 @@ public class InputControl extends MyObservable implements java.io.Serializable {
|
|||||||
* updateInput.
|
* updateInput.
|
||||||
* </p>
|
* </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() )
|
if ( !game.hasMulliganned() )
|
||||||
return new InputMulligan();
|
return new InputMulligan();
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ public class InputControl extends MyObservable implements java.io.Serializable {
|
|||||||
public final void setNewInput(GameState game) {
|
public final void setNewInput(GameState game) {
|
||||||
PhaseHandler ph = game.getPhaseHandler();
|
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);
|
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);
|
System.out.println(message);
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import forge.view.ButtonUtil;
|
|||||||
* TODO: Write javadoc for this type.
|
* TODO: Write javadoc for this type.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class InputLockUI extends Input {
|
public class InputLockUI extends InputBase {
|
||||||
private static final long serialVersionUID = 5777143577098597374L;
|
private static final long serialVersionUID = 5777143577098597374L;
|
||||||
|
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import forge.view.ButtonUtil;
|
|||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class InputMulligan extends Input {
|
public class InputMulligan extends InputBase {
|
||||||
/** Constant <code>serialVersionUID=-8112954303001155622L</code>. */
|
/** Constant <code>serialVersionUID=-8112954303001155622L</code>. */
|
||||||
private static final long serialVersionUID = -8112954303001155622L;
|
private static final long serialVersionUID = -8112954303001155622L;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import forge.view.ButtonUtil;
|
|||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class InputPassPriority extends Input {
|
public class InputPassPriority extends InputBase {
|
||||||
/** Constant <code>serialVersionUID=-581477682214137181L</code>. */
|
/** Constant <code>serialVersionUID=-581477682214137181L</code>. */
|
||||||
private static final long serialVersionUID = -581477682214137181L;
|
private static final long serialVersionUID = -581477682214137181L;
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import forge.view.ButtonUtil;
|
|||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id: InputPayManaCostAbility.java 15673 2012-05-23 14:01:35Z ArsenalNut $
|
* @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>.
|
* Constant <code>serialVersionUID=2685832214529141991L</code>.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import forge.gui.match.views.VMessage;
|
|||||||
* TODO: Write javadoc for this type.
|
* TODO: Write javadoc for this type.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class InputPayManaBase extends Input {
|
public abstract class InputPayManaBase extends InputBase {
|
||||||
|
|
||||||
private static final long serialVersionUID = -9133423708688480255L;
|
private static final long serialVersionUID = -9133423708688480255L;
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class InputPayManaOfCostPayment extends InputPayManaBase {
|
|||||||
payment.setPaidPart(costMana);
|
payment.setPaidPart(costMana);
|
||||||
} else {
|
} else {
|
||||||
source.setXManaCostPaid(0);
|
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);
|
Singletons.getModel().getMatch().getInput().setInputInterrupt(inp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ import forge.view.ButtonUtil;
|
|||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id: InputPayManaCostAbility.java 15673 2012-05-23 14:01:35Z ArsenalNut $
|
* @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>.
|
* Constant <code>serialVersionUID=2685832214529141991L</code>.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import forge.view.ButtonUtil;
|
|||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id: InputPayManaCostAbility.java 15673 2012-05-23 14:01:35Z ArsenalNut $
|
* @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>.
|
* Constant <code>serialVersionUID=2685832214529141991L</code>.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import forge.view.ButtonUtil;
|
|||||||
* TODO: Write javadoc for this type.
|
* 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;
|
private static final long serialVersionUID = -2305549394512889450L;
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ public abstract class InputSelectMany<T extends GameEntity> extends Input {
|
|||||||
@Override
|
@Override
|
||||||
public final void selectButtonCancel() {
|
public final void selectButtonCancel() {
|
||||||
// this.stop();
|
// 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 ) {
|
// if ( next != null ) {
|
||||||
// Singletons.getModel().getMatch().getInput().setInput(next);
|
// 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
|
// if it does, uncomment the 5 lines below, use them as method body
|
||||||
|
|
||||||
// this.stop();
|
// 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 ) {
|
// if ( next != null ) {
|
||||||
// Singletons.getModel().getMatch().getInput().setInput(next);
|
// Singletons.getModel().getMatch().getInput().setInput(next);
|
||||||
// }
|
// }
|
||||||
@@ -112,11 +112,11 @@ public abstract class InputSelectMany<T extends GameEntity> extends Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// must define these
|
// must define these
|
||||||
protected abstract Input onDone();
|
protected abstract InputBase onDone();
|
||||||
protected abstract boolean isValidChoice(T choice);
|
protected abstract boolean isValidChoice(T choice);
|
||||||
|
|
||||||
// might re-define later
|
// might re-define later
|
||||||
protected Input onCancel() { return null; }
|
protected InputBase onCancel() { return null; }
|
||||||
protected boolean canCancelWithSomethingSelected() { return false; }
|
protected boolean canCancelWithSomethingSelected() { return false; }
|
||||||
protected boolean hasEnoughTargets() { return selected.size() >= min; }
|
protected boolean hasEnoughTargets() { return selected.size() >= min; }
|
||||||
protected boolean hasAllTargets() { return selected.size() >= max; }
|
protected boolean hasAllTargets() { return selected.size() >= max; }
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import forge.game.player.Player;
|
|||||||
public class InputSelectManyPlayers extends InputSelectMany<Player> {
|
public class InputSelectManyPlayers extends InputSelectMany<Player> {
|
||||||
private static final long serialVersionUID = -8209690791522735L;
|
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;
|
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);
|
super(min, max);
|
||||||
allowedFilter = allowedRule;
|
allowedFilter = allowedRule;
|
||||||
@@ -34,7 +34,7 @@ public class InputSelectManyPlayers extends InputSelectMany<Player> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Input onDone() {
|
protected InputBase onDone() {
|
||||||
return onComplete.apply(selected);
|
return onComplete.apply(selected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ import forge.card.spellability.AbilityManaPart;
|
|||||||
import forge.card.spellability.AbilitySub;
|
import forge.card.spellability.AbilitySub;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.card.spellability.SpellAbilityRestriction;
|
import forge.card.spellability.SpellAbilityRestriction;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.control.input.InputPayDiscardCostWithCommands;
|
import forge.control.input.InputPayDiscardCostWithCommands;
|
||||||
import forge.control.input.InputPayManaExecuteCommands;
|
import forge.control.input.InputPayManaExecuteCommands;
|
||||||
import forge.control.input.InputPayReturnCost;
|
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
|
//the following costs need inputs and can't be combined at the moment
|
||||||
|
|
||||||
|
|
||||||
Input toSet = null;
|
InputBase toSet = null;
|
||||||
CountDownLatch cdl = new CountDownLatch(1);
|
CountDownLatch cdl = new CountDownLatch(1);
|
||||||
if (costPart instanceof CostReturn) {
|
if (costPart instanceof CostReturn) {
|
||||||
toSet = new InputPayReturnCost((CostReturn) costPart, ability, cdl);
|
toSet = new InputPayReturnCost((CostReturn) costPart, ability, cdl);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package forge.game.ai;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.phase.CombatUtil;
|
import forge.game.phase.CombatUtil;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -12,7 +12,7 @@ import forge.game.player.Player;
|
|||||||
* TODO: Write javadoc for this type.
|
* TODO: Write javadoc for this type.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class AiInputBlock extends Input {
|
public class AiInputBlock extends InputBase {
|
||||||
|
|
||||||
private final GameState game;
|
private final GameState game;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
package forge.game.ai;
|
package forge.game.ai;
|
||||||
|
|
||||||
import forge.FThreads;
|
import forge.FThreads;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -28,7 +28,7 @@ import forge.control.input.Input;
|
|||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class AiInputCommon extends Input {
|
public class AiInputCommon extends InputBase {
|
||||||
/** Constant <code>serialVersionUID=-3091338639571662216L</code>. */
|
/** Constant <code>serialVersionUID=-3091338639571662216L</code>. */
|
||||||
private static final long serialVersionUID = -3091338639571662216L;
|
private static final long serialVersionUID = -3091338639571662216L;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import forge.CardPredicates.Presets;
|
|||||||
import forge.CounterType;
|
import forge.CounterType;
|
||||||
import forge.GameEntity;
|
import forge.GameEntity;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.ai.ComputerUtilCard;
|
import forge.game.ai.ComputerUtilCard;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -210,7 +210,7 @@ public class Untap extends Phase {
|
|||||||
landList.get(0).untap();
|
landList.get(0).untap();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final Input target = new Input() {
|
final InputBase target = new InputBase() {
|
||||||
private static final long serialVersionUID = 6653677835629939465L;
|
private static final long serialVersionUID = 6653677835629939465L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -250,7 +250,7 @@ public class Untap extends Phase {
|
|||||||
ComputerUtilCard.getBestArtifactAI(artList).untap();
|
ComputerUtilCard.getBestArtifactAI(artList).untap();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final Input target = new Input() {
|
final InputBase target = new InputBase() {
|
||||||
private static final long serialVersionUID = 5555427219659889707L;
|
private static final long serialVersionUID = 5555427219659889707L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -290,7 +290,7 @@ public class Untap extends Phase {
|
|||||||
creatures.get(0).untap();
|
creatures.get(0).untap();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final Input target = new Input() {
|
final InputBase target = new InputBase() {
|
||||||
private static final long serialVersionUID = 5555427219659889707L;
|
private static final long serialVersionUID = 5555427219659889707L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ import forge.card.spellability.Ability;
|
|||||||
import forge.card.spellability.AbilityManaPart;
|
import forge.card.spellability.AbilityManaPart;
|
||||||
import forge.card.spellability.AbilityStatic;
|
import forge.card.spellability.AbilityStatic;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.control.input.InputPayManaExecuteCommands;
|
import forge.control.input.InputPayManaExecuteCommands;
|
||||||
import forge.control.input.InputSelectManyCards;
|
import forge.control.input.InputSelectManyCards;
|
||||||
import forge.game.GameActionUtil;
|
import forge.game.GameActionUtil;
|
||||||
@@ -464,7 +464,7 @@ public class Upkeep extends Phase {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
final List<Card> targets = CardLists.getTargetableCards(abyssGetTargets, this);
|
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;
|
private static final long serialVersionUID = 4820011040853968644L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -478,7 +478,7 @@ public class Upkeep extends Phase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Input onDone() {
|
protected InputBase onDone() {
|
||||||
game.getAction().destroyNoRegeneration(selected.get(0));
|
game.getAction().destroyNoRegeneration(selected.get(0));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -1034,7 +1034,7 @@ public class Upkeep extends Phase {
|
|||||||
list.remove(toTap);
|
list.remove(toTap);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Singletons.getModel().getMatch().getInput().setInput(new Input() {
|
Singletons.getModel().getMatch().getInput().setInput(new InputBase() {
|
||||||
private static final long serialVersionUID = 5313424586016061612L;
|
private static final long serialVersionUID = 5313424586016061612L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import org.apache.commons.lang3.tuple.ImmutablePair;
|
|||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.GameEntity;
|
import forge.GameEntity;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.deck.Deck;
|
import forge.deck.Deck;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.GameType;
|
import forge.game.GameType;
|
||||||
@@ -32,9 +32,9 @@ public abstract class PlayerController {
|
|||||||
public PlayerController(GameState game0) {
|
public PlayerController(GameState game0) {
|
||||||
game = game0;
|
game = game0;
|
||||||
}
|
}
|
||||||
public abstract Input getDefaultInput();
|
public abstract InputBase getDefaultInput();
|
||||||
public abstract Input getBlockInput();
|
public abstract InputBase getBlockInput();
|
||||||
public abstract Input getCleanupInput();
|
public abstract InputBase getCleanupInput();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import forge.Card;
|
|||||||
import forge.GameEntity;
|
import forge.GameEntity;
|
||||||
import forge.card.spellability.Spell;
|
import forge.card.spellability.Spell;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.deck.Deck;
|
import forge.deck.Deck;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.GameType;
|
import forge.game.GameType;
|
||||||
@@ -32,15 +32,15 @@ import forge.gui.GuiChoose;
|
|||||||
*/
|
*/
|
||||||
public class PlayerControllerAi extends PlayerController {
|
public class PlayerControllerAi extends PlayerController {
|
||||||
|
|
||||||
private Input defaultInput;
|
private InputBase defaultInput;
|
||||||
private Input blockInput;
|
private InputBase blockInput;
|
||||||
private Input cleanupInput;
|
private InputBase cleanupInput;
|
||||||
|
|
||||||
private final AiController brains;
|
private final AiController brains;
|
||||||
private final AIPlayer player;
|
private final AIPlayer player;
|
||||||
|
|
||||||
|
|
||||||
public final Input getDefaultInput() {
|
public final InputBase getDefaultInput() {
|
||||||
return defaultInput;
|
return defaultInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,14 +70,14 @@ public class PlayerControllerAi extends PlayerController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Input to use when player has to declare blockers */
|
/** Input to use when player has to declare blockers */
|
||||||
public Input getBlockInput() {
|
public InputBase getBlockInput() {
|
||||||
return blockInput;
|
return blockInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the cleanupInput
|
* @return the cleanupInput
|
||||||
*/
|
*/
|
||||||
public Input getCleanupInput() {
|
public InputBase getCleanupInput() {
|
||||||
return cleanupInput;
|
return cleanupInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.apache.commons.lang3.tuple.ImmutablePair;
|
|||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.GameEntity;
|
import forge.GameEntity;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.control.input.InputBlock;
|
import forge.control.input.InputBlock;
|
||||||
import forge.control.input.InputCleanup;
|
import forge.control.input.InputCleanup;
|
||||||
import forge.control.input.InputPassPriority;
|
import forge.control.input.InputPassPriority;
|
||||||
@@ -38,12 +38,12 @@ import forge.item.CardPrinted;
|
|||||||
*/
|
*/
|
||||||
public class PlayerControllerHuman extends PlayerController {
|
public class PlayerControllerHuman extends PlayerController {
|
||||||
|
|
||||||
private final Input defaultInput;
|
private final InputBase defaultInput;
|
||||||
private final Input blockInput;
|
private final InputBase blockInput;
|
||||||
private final Input cleanupInput;
|
private final InputBase cleanupInput;
|
||||||
private final HumanPlayer player;
|
private final HumanPlayer player;
|
||||||
|
|
||||||
public final Input getDefaultInput() {
|
public final InputBase getDefaultInput() {
|
||||||
return defaultInput;
|
return defaultInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,14 +75,14 @@ public class PlayerControllerHuman extends PlayerController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Input to use when player has to declare blockers */
|
/** Input to use when player has to declare blockers */
|
||||||
public Input getBlockInput() {
|
public InputBase getBlockInput() {
|
||||||
return blockInput;
|
return blockInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the cleanupInput
|
* @return the cleanupInput
|
||||||
*/
|
*/
|
||||||
public Input getCleanupInput() {
|
public InputBase getCleanupInput() {
|
||||||
return cleanupInput;
|
return cleanupInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import forge.Card;
|
|||||||
import forge.CardLists;
|
import forge.CardLists;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.zone.Zone;
|
import forge.game.zone.Zone;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
import forge.gui.match.CMatchUI;
|
import forge.gui.match.CMatchUI;
|
||||||
@@ -54,12 +54,12 @@ public final class PlayerUtil {
|
|||||||
* a {@link java.lang.String} object.
|
* a {@link java.lang.String} object.
|
||||||
* @param sa
|
* @param sa
|
||||||
* a {@link forge.card.spellability.SpellAbility} object.
|
* 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
|
* @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 SpellAbility sp = sa;
|
||||||
final Input target = new Input() {
|
final InputBase target = new InputBase() {
|
||||||
private static final long serialVersionUID = 8822292413831640944L;
|
private static final long serialVersionUID = 8822292413831640944L;
|
||||||
|
|
||||||
private int n = 0;
|
private int n = 0;
|
||||||
@@ -111,12 +111,12 @@ public final class PlayerUtil {
|
|||||||
* a int.
|
* a int.
|
||||||
* @param sa
|
* @param sa
|
||||||
* a {@link forge.card.spellability.SpellAbility} object.
|
* 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
|
* @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 SpellAbility sp = sa;
|
||||||
final Input target = new Input() {
|
final InputBase target = new InputBase() {
|
||||||
private static final long serialVersionUID = -329993322080934435L;
|
private static final long serialVersionUID = -329993322080934435L;
|
||||||
|
|
||||||
private int n = 0;
|
private int n = 0;
|
||||||
@@ -162,10 +162,10 @@ public final class PlayerUtil {
|
|||||||
* a int.
|
* a int.
|
||||||
* @param type
|
* @param type
|
||||||
* a {@link java.lang.String} object.
|
* 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
|
* @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);
|
final List<Card> list = CardLists.getType(Singletons.getControl().getPlayer().getCardsIn(ZoneType.Battlefield), type);
|
||||||
|
|
||||||
return PlayerUtil.inputSacrificePermanentsFromList(nCards, list, "Select a " + type + " to sacrifice");
|
return PlayerUtil.inputSacrificePermanentsFromList(nCards, list, "Select a " + type + " to sacrifice");
|
||||||
@@ -182,11 +182,11 @@ public final class PlayerUtil {
|
|||||||
* a {@link forge.CardList} object.
|
* a {@link forge.CardList} object.
|
||||||
* @param message
|
* @param message
|
||||||
* a {@link java.lang.String} object.
|
* 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
|
* @since 1.0.15
|
||||||
*/
|
*/
|
||||||
public static Input inputSacrificePermanentsFromList(final int nCards, final List<Card> list, final String message) {
|
public static InputBase inputSacrificePermanentsFromList(final int nCards, final List<Card> list, final String message) {
|
||||||
final Input target = new Input() {
|
final InputBase target = new InputBase() {
|
||||||
private static final long serialVersionUID = 1981791992623774490L;
|
private static final long serialVersionUID = 1981791992623774490L;
|
||||||
private int n = 0;
|
private int n = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import forge.card.spellability.TargetChoices;
|
|||||||
import forge.card.spellability.TargetSelection;
|
import forge.card.spellability.TargetSelection;
|
||||||
import forge.card.trigger.Trigger;
|
import forge.card.trigger.Trigger;
|
||||||
import forge.card.trigger.TriggerType;
|
import forge.card.trigger.TriggerType;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.control.input.InputPayManaExecuteCommands;
|
import forge.control.input.InputPayManaExecuteCommands;
|
||||||
import forge.game.GameActionUtil;
|
import forge.game.GameActionUtil;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
@@ -859,7 +859,7 @@ public class MagicStack extends MyObservable {
|
|||||||
if (creats.size() != 0) {
|
if (creats.size() != 0) {
|
||||||
haunterDiesWork.setDescription("");
|
haunterDiesWork.setDescription("");
|
||||||
|
|
||||||
final Input target = new Input() {
|
final InputBase target = new InputBase() {
|
||||||
private static final long serialVersionUID = 1981791992623774490L;
|
private static final long serialVersionUID = 1981791992623774490L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import java.util.Observer;
|
|||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.FThreads;
|
import forge.FThreads;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.view.ButtonUtil;
|
import forge.view.ButtonUtil;
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ import forge.view.ButtonUtil;
|
|||||||
public class InputProxy implements Observer {
|
public class InputProxy implements Observer {
|
||||||
|
|
||||||
/** The input. */
|
/** The input. */
|
||||||
private Input input;
|
private InputBase input;
|
||||||
private boolean valid = false;
|
private boolean valid = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -54,9 +54,9 @@ public class InputProxy implements Observer {
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param in
|
* @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;
|
valid = true;
|
||||||
this.input = in;
|
this.input = in;
|
||||||
|
|
||||||
@@ -122,8 +122,8 @@ public class InputProxy implements Observer {
|
|||||||
return this.getInput().toString();
|
return this.getInput().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return {@link forge.gui.InputProxy.Input} */
|
/** @return {@link forge.gui.InputProxy.InputBase} */
|
||||||
public Input getInput() {
|
public InputBase getInput() {
|
||||||
return this.input;
|
return this.input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import forge.Singletons;
|
|||||||
import forge.card.cardfactory.CardFactory;
|
import forge.card.cardfactory.CardFactory;
|
||||||
import forge.card.cardfactory.CardFactoryUtil;
|
import forge.card.cardfactory.CardFactoryUtil;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.InputBase;
|
||||||
import forge.control.input.InputAttack;
|
import forge.control.input.InputAttack;
|
||||||
import forge.control.input.InputBlock;
|
import forge.control.input.InputBlock;
|
||||||
import forge.control.input.InputPayManaBase;
|
import forge.control.input.InputPayManaBase;
|
||||||
@@ -388,7 +388,7 @@ public class CField implements ICDoc {
|
|||||||
// Roujin's bug fix version dated 2-12-2012
|
// Roujin's bug fix version dated 2-12-2012
|
||||||
final Card c = CField.this.view.getTabletop().getHoveredCard(e);
|
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 != null && c.isInZone(ZoneType.Battlefield)) {
|
||||||
if (c.isTapped() && (input instanceof InputPayManaSimple || input instanceof InputPayManaExecuteCommands)) {
|
if (c.isTapped() && (input instanceof InputPayManaSimple || input instanceof InputPayManaExecuteCommands)) {
|
||||||
@@ -443,7 +443,7 @@ public class CField implements ICDoc {
|
|||||||
/** */
|
/** */
|
||||||
private void manaAction(String constantColor) {
|
private void manaAction(String constantColor) {
|
||||||
if (CField.this.player == CField.this.playerViewer) {
|
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) {
|
if (in instanceof InputPayManaBase) {
|
||||||
// Do something
|
// Do something
|
||||||
((InputPayManaBase) in).selectManaPool(constantColor);
|
((InputPayManaBase) in).selectManaPool(constantColor);
|
||||||
|
|||||||
Reference in New Issue
Block a user