From d380ceae2027bc83e93d86547adc81a0f3cbcf23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 20 Mar 2016 23:34:35 +0100 Subject: StateType,Ctrl: add LOADING state and Ctrl.isLoading() --- core/src/ch/asynk/rustanddust/game/Ctrl.java | 11 +++++++++-- 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, -- cgit v1.1-2-g2b99