diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-14 12:08:13 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-14 12:08:13 +0100 |
commit | 2465a1742e9caac4eb5056751767d77cde9f55f7 (patch) | |
tree | b31f476db8d6aaeb0447dcc6a70c8390fc286e16 /core/src/ch/asynk/tankontank | |
parent | a62f0ff2f85b275d903f44b8c79df9351e726454 (diff) | |
download | RustAndDust-2465a1742e9caac4eb5056751767d77cde9f55f7.zip RustAndDust-2465a1742e9caac4eb5056751767d77cde9f55f7.tar.gz |
Ctrl: import and use State.StateType
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Ctrl.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index 4ef78a8..3c3b5f0 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -4,7 +4,7 @@ import com.badlogic.gdx.utils.Disposable; import ch.asynk.tankontank.TankOnTank; import ch.asynk.tankontank.game.hud.Position; -import ch.asynk.tankontank.game.states.StateCommon; +import ch.asynk.tankontank.game.State.StateType; import ch.asynk.tankontank.game.states.StateSelect; import ch.asynk.tankontank.game.states.StateMove; import ch.asynk.tankontank.game.states.StateRotate; @@ -41,8 +41,8 @@ public class Ctrl implements Disposable private int animationCount = 0; private State state; - private State.StateType stateType; - private State.StateType stateAfterAnimation; + private StateType stateType; + private StateType stateAfterAnimation; public Ctrl(final TankOnTank game, final Battle battle) { @@ -66,7 +66,7 @@ public class Ctrl implements Disposable this.reinforcementState = new StateReinforcement(); this.state = selectState; - this.stateType = State.StateType.DONE; + this.stateType = StateType.DONE; this.hud = new Hud(this, game); this.blockMap = false; @@ -133,20 +133,20 @@ public class Ctrl implements Disposable startPlayerTurn(); } - private State.StateType actionAborted() + private StateType actionAborted() { hud.notify("Action canceled"); - State.StateType nextState = this.state.abort(); + StateType nextState = this.state.abort(); - if (nextState == State.StateType.ABORT) + if (nextState == StateType.ABORT) nextState = battle.getState(player); return nextState; } - private State.StateType actionDone() + private StateType actionDone() { - State.StateType nextState = this.state.done(); + StateType nextState = this.state.done(); if (map.activatedPawns.size() > 0) { player.burnDownOneAp(); @@ -156,7 +156,7 @@ public class Ctrl implements Disposable if (player.apExhausted()) swicthPlayer(); - if (nextState == State.StateType.DONE) + if (nextState == StateType.DONE) nextState = battle.getState(player); return nextState; @@ -167,7 +167,7 @@ public class Ctrl implements Disposable this.state.touchUp(); } - public void toggleState(State.StateType stateA, State.StateType stateB) + public void toggleState(StateType stateA, StateType stateB) { if (this.stateType == stateA) { setState(stateB); @@ -178,18 +178,18 @@ public class Ctrl implements Disposable } } - public void setState(State.StateType nextState) + public void setState(StateType nextState) { setState(nextState, battle.getState(player)); } - public void setState(State.StateType nextState, State.StateType whenDone) + public void setState(StateType nextState, StateType whenDone) { - if (nextState == State.StateType.ABORT) + if (nextState == StateType.ABORT) nextState = actionAborted(); - else if (nextState == State.StateType.DONE) + else if (nextState == StateType.DONE) nextState = actionDone(); - else if (nextState == State.StateType.ANIMATION) + else if (nextState == StateType.ANIMATION) stateAfterAnimation = whenDone; this.state.leave(nextState); |