diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-03-20 23:34:35 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-03-20 23:34:35 +0100 |
commit | d380ceae2027bc83e93d86547adc81a0f3cbcf23 (patch) | |
tree | d7c166e361a963530fb8594f63baeccf1f7799ed | |
parent | 271949ec25a360eb3fc41c1c48b4977313a25879 (diff) | |
download | RustAndDust-d380ceae2027bc83e93d86547adc81a0f3cbcf23.zip RustAndDust-d380ceae2027bc83e93d86547adc81a0f3cbcf23.tar.gz |
StateType,Ctrl: add LOADING state and Ctrl.isLoading()
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Ctrl.java | 11 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/State.java | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index 871dba6..96dffa9 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -84,8 +84,7 @@ public abstract class Ctrl implements Disposable this.deploymentState = new StateDeployment(); this.withdrawState = new StateWithdraw(); - this.state = selectState; - this.stateType = StateType.DONE; + this.stateType = StateType.LOADING; battle.init(); this.map = battle.getMap(); @@ -94,6 +93,9 @@ public abstract class Ctrl implements Disposable hud.update(); this.hud.notify(battle.toString(), 2, Position.MIDDLE_CENTER, false); + this.state = selectState; + this.stateType = StateType.DONE; + setState(battle.getState()); } @@ -105,6 +107,11 @@ public abstract class Ctrl implements Disposable battle.desinit(); } + public boolean isLoading() + { + return (stateType == StateType.LOADING); + } + // INPUTS public boolean drag(float x, float y, int dx, int dy) diff --git a/core/src/ch/asynk/rustanddust/game/State.java b/core/src/ch/asynk/rustanddust/game/State.java index 73a0f5b..114c680 100644 --- a/core/src/ch/asynk/rustanddust/game/State.java +++ b/core/src/ch/asynk/rustanddust/game/State.java @@ -3,6 +3,7 @@ package ch.asynk.rustanddust.game; public interface State { enum StateType { + LOADING, SELECT, MOVE, ROTATE, |