summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/ch/asynk/tankontank/game/Ctrl.java12
-rw-r--r--core/src/ch/asynk/tankontank/game/Hud.java13
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;