diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-16 01:22:38 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-16 01:22:38 +0100 |
commit | feeb9296de6d509c4e5575211cd47a115793e976 (patch) | |
tree | a0d260f6860af25c45aa64685e05fa4635db72ad /core/src/ch/asynk/tankontank | |
parent | d805f2aeaaff790c0c3d2cc7fb937ac325d92a89 (diff) | |
download | RustAndDust-feeb9296de6d509c4e5575211cd47a115793e976.zip RustAndDust-feeb9296de6d509c4e5575211cd47a115793e976.tar.gz |
Ctrl,Hud: add checkDeploymentDone(), endDeployment(), askEndDeployment()
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Ctrl.java | 12 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 13 |
2 files changed, 25 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index aaea495..b507eaf 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -237,6 +237,13 @@ public class Ctrl implements Disposable this.state.touchUp(); } + public boolean checkDeploymentDone() + { + boolean done = battle.deploymentDone(player); + if (done) + hud.askEndDeployment(); + return done; + } public void reinforcementHit() { @@ -251,6 +258,11 @@ public class Ctrl implements Disposable stateAfterAnimation = after; } + public void endDeployment() + { + switchPlayer(); + } + public void endGame() { game.setScreen(new OptionsScreen(game)); diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 85bbf3d..8812061 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -38,6 +38,7 @@ public class Hud implements Disposable enum DialogAction { END_TURN, + END_DEPLOYMENT, END_GAME } @@ -165,6 +166,11 @@ public class Hud implements Disposable ctrl.abortPlayerTurn(); okCancel.visible = false; break; + case END_DEPLOYMENT: + if (okCancel.ok) + ctrl.endDeployment(); + okCancel.visible = false; + break; case END_GAME: stats.visible = false; ctrl.endGame(); @@ -187,6 +193,13 @@ public class Hud implements Disposable okCancel.show("You still have Action Points left.\nEnd your Turn anyway ?", Position.MIDDLE_CENTER); } + public void askEndDeployment() + { + ctrl.blockMap = true; + dialogAction = DialogAction.END_DEPLOYMENT; + okCancel.show("Deployment unit count reached.\nEnd Deployment phase ?", Position.MIDDLE_CENTER); + } + public void victory(Player winner, Player loser) { ctrl.blockMap = true; |