diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-11 18:23:16 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-11 18:23:16 +0100 |
commit | e297e981cdb8e4136911339f1f99a742eafa4ae5 (patch) | |
tree | af9e09f1248d2977cada22d116893dee0bcab2ac /core | |
parent | 68283b5fa86ad41ec495324fdae10912b806259c (diff) | |
download | RustAndDust-e297e981cdb8e4136911339f1f99a742eafa4ae5.zip RustAndDust-e297e981cdb8e4136911339f1f99a742eafa4ae5.tar.gz |
Ctrl,Hud: replace changeState(...) with stateTouchUp() and toggleState(...)
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Ctrl.java | 17 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 12 |
2 files changed, 16 insertions, 13 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index 98a5ca2..c42de49 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -134,6 +134,22 @@ public class Ctrl implements Disposable nextPlayer(); } + public void stateTouchUp() + { + this.state.touchUp(); + } + + public void toggleState(State.StateType stateA, State.StateType stateB) + { + if (this.stateType == stateA) { + setState(stateB); + } else if (this.stateType == stateB) { + setState(stateA); + } else { + TankOnTank.debug("Ctrl", "wrong call to toggleState()"); + } + } + public void setState(State.StateType state) { if (state == State.StateType.ABORT) { @@ -148,7 +164,6 @@ public class Ctrl implements Disposable public void setState(State.StateType state, boolean normal) { - hud.changeState(stateType, state); this.state.leave(state); TankOnTank.debug(" switch to : " + state + " " + normal); diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 5087abe..3afd2dc 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -68,18 +68,6 @@ public class Hud implements Disposable stats.dispose(); } - public void changeState(StateType from, StateType to) - { - // if (to != StateType.ENTRY); - // playerInfo.hideUnitDock(); - // TODO when reselect another -> do not hide Dock - - if ((to == StateType.SELECT) || (to == StateType.ENTRY)) - playerInfo.blockReinforcement(false); - else - playerInfo.blockReinforcement(true); - } - public void update() { Position position = ctrl.battle.getHudPosition(ctrl.player); |