mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
InputControl.java - getActualInput: moved stack extraction to top. so that mulligan input is returned only with empty stack.
This commit is contained in:
@@ -22,8 +22,10 @@ import java.util.Stack;
|
|||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
import forge.game.GameType;
|
import forge.game.GameType;
|
||||||
|
import forge.game.MatchController;
|
||||||
import forge.game.phase.PhaseHandler;
|
import forge.game.phase.PhaseHandler;
|
||||||
import forge.game.phase.PhaseType;
|
import forge.game.phase.PhaseType;
|
||||||
|
import forge.game.player.HumanPlayer;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.player.PlayerController;
|
import forge.game.player.PlayerController;
|
||||||
import forge.game.zone.MagicStack;
|
import forge.game.zone.MagicStack;
|
||||||
@@ -116,16 +118,14 @@ public class InputControl extends MyObservable implements java.io.Serializable {
|
|||||||
* @return a {@link forge.control.input.InputBase} object.
|
* @return a {@link forge.control.input.InputBase} object.
|
||||||
*/
|
*/
|
||||||
public final Input getActualInput(GameState game) {
|
public final Input getActualInput(GameState game) {
|
||||||
if ( !game.hasMulliganned() )
|
if (!this.inputStack.isEmpty()) { // incoming input to Control
|
||||||
{
|
return this.inputStack.peek();
|
||||||
if(game.getType() == GameType.Commander)
|
}
|
||||||
{
|
|
||||||
return new InputPartialParisMulligan(Singletons.getModel().getMatch(), Singletons.getControl().getPlayer());
|
if ( !game.hasMulliganned() ) {
|
||||||
}
|
HumanPlayer human = Singletons.getControl().getPlayer();
|
||||||
else
|
MatchController match = Singletons.getModel().getMatch();
|
||||||
{
|
return game.getType() == GameType.Commander ? new InputPartialParisMulligan(match, human) : new InputMulligan(match, human);
|
||||||
return new InputMulligan(Singletons.getModel().getMatch(), Singletons.getControl().getPlayer());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
final PhaseHandler handler = game.getPhaseHandler();
|
final PhaseHandler handler = game.getPhaseHandler();
|
||||||
final PhaseType phase = handler.getPhase();
|
final PhaseType phase = handler.getPhase();
|
||||||
@@ -135,13 +135,6 @@ public class InputControl extends MyObservable implements java.io.Serializable {
|
|||||||
throw new RuntimeException("No player has priority!");
|
throw new RuntimeException("No player has priority!");
|
||||||
PlayerController pc = priority.getController();
|
PlayerController pc = priority.getController();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!this.inputStack.isEmpty()) { // incoming input to Control
|
|
||||||
return this.inputStack.peek();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// If the Phase we're in doesn't allow for Priority, move to next phase
|
// If the Phase we're in doesn't allow for Priority, move to next phase
|
||||||
if (!handler.isPlayerPriorityAllowed()) {
|
if (!handler.isPlayerPriorityAllowed()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user