summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/ch/asynk/tankontank/game/Player.java29
1 files changed, 16 insertions, 13 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Player.java b/core/src/ch/asynk/tankontank/game/Player.java
index 9bc1c2b..34f933f 100644
--- a/core/src/ch/asynk/tankontank/game/Player.java
+++ b/core/src/ch/asynk/tankontank/game/Player.java
@@ -140,24 +140,24 @@ public class Player
return ((apSpent < actionPoints) ? (apSpent + 1) : apSpent);
}
- public int getTurn()
+ public int getTurnDone()
{
return turn;
}
- public boolean apExhausted()
+ public int getCurrentTurn()
{
- return (apSpent == actionPoints);
+ return (turn + 1);
}
- public boolean isDeploymentDone()
+ public boolean apExhausted()
{
- return deploymentDone;
+ return (apSpent == actionPoints);
}
- public void deploymentDone()
+ public boolean isDeploymentDone()
{
- deploymentDone = true;
+ return (deploymentDone || (reinforcement.size() == 0));
}
public void burnDownOneAp()
@@ -169,16 +169,19 @@ public class Player
public void turnEnd()
{
+ if (deploymentDone)
+ turn += 1;
+ else
+ deploymentDone = (reinforcement.size() == 0);
}
public void turnStart()
{
- if (!deploymentDone)
- return;
- turn += 1;
- for (Unit unit : units)
- unit.reset();
- computeActionPoints();
+ if (isDeploymentDone()) {
+ for (Unit unit : units)
+ unit.reset();
+ computeActionPoints();
+ }
}
public int d6()