From 3f565c31f0738b40e41471d33cb693da5d315056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 18 Feb 2016 14:41:46 +0100 Subject: StateDeployment,Ctrl: clean up deployment completness procedure --- core/src/ch/asynk/rustanddust/game/Ctrl.java | 11 ++++------- .../src/ch/asynk/rustanddust/game/states/StateDeployment.java | 5 +---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index 7b96ae5..6a6dad5 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -146,11 +146,6 @@ public abstract class Ctrl implements Disposable stateAfterAnimation = after; } - public void unitDeployed() - { - battle.actionDone(); - } - // Hud callbacks public void endGame() @@ -166,7 +161,7 @@ public abstract class Ctrl implements Disposable public void endDeployment() { - setState(StateType.DONE); + this.state.execute(); turnDone(); } @@ -244,8 +239,10 @@ public abstract class Ctrl implements Disposable private StateType completeDeployment() { + if (battle.isDeploymentDone()) + hud.askEndDeployment(); battle.actionDone(); - return this.state.execute(); + return StateType.DEPLOYMENT; } private StateType abortAction() diff --git a/core/src/ch/asynk/rustanddust/game/states/StateDeployment.java b/core/src/ch/asynk/rustanddust/game/states/StateDeployment.java index a209b87..97acf9e 100644 --- a/core/src/ch/asynk/rustanddust/game/states/StateDeployment.java +++ b/core/src/ch/asynk/rustanddust/game/states/StateDeployment.java @@ -123,9 +123,6 @@ public class StateDeployment extends StateCommon map.hexDirectionsHide(selectedHex); ctrl.hud.actionButtons.hide(); ctrl.hud.playerInfo.unitDock.show(); - if (ctrl.battle.isDeploymentDone()) - ctrl.hud.askEndDeployment(); - else - ctrl.unitDeployed(); + ctrl.setState(StateType.DONE); } } -- cgit v1.1-2-g2b99