diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-19 14:16:29 +0100 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-19 14:16:29 +0100 | 
| commit | 806ad0b70ba6e276afdd873076c66949bd8f4cd8 (patch) | |
| tree | aa991d00967725269629c598d8093196fbc92afe | |
| parent | ec060a407de022180e695f2f321d0385cd98e52c (diff) | |
| download | RustAndDust-806ad0b70ba6e276afdd873076c66949bd8f4cd8.zip RustAndDust-806ad0b70ba6e276afdd873076c66949bd8f4cd8.tar.gz | |
Player: turn is turnDone, inc at turnEnd() if deployment done
| -rw-r--r-- | core/src/ch/asynk/tankontank/game/Player.java | 29 | 
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() | 
