From 69525d8238a0b2e04ce2a34f6daac00bd2f2c132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 31 Jan 2016 09:26:32 +0100 Subject: Player: get rid of booleam deploymentDone --- core/src/ch/asynk/rustanddust/game/Player.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/Player.java b/core/src/ch/asynk/rustanddust/game/Player.java index 9ee087a..f81db0e 100644 --- a/core/src/ch/asynk/rustanddust/game/Player.java +++ b/core/src/ch/asynk/rustanddust/game/Player.java @@ -10,7 +10,6 @@ public class Player private int turn; private int apSpent; private int actionPoints; - private boolean deploymentDone; public Army army; public UnitList units; @@ -34,7 +33,6 @@ public class Player this.turn = 0; this.apSpent = 0; this.actionPoints = 0; - this.deploymentDone = false; this.actionCount = 0; this.objectivesWon = 0; this.engagementWon = 0; @@ -76,6 +74,11 @@ public class Player return army.isEnemy(other); } + public boolean hasReinforcement() + { + return (reinforcement() > 0); + } + public int unitsLeft() { return (units.size() + reinforcement.size()); @@ -163,7 +166,7 @@ public class Player public boolean isDeploymentDone() { - return (deploymentDone || (reinforcement.size() == 0)); + return ((turn > 0) || !hasReinforcement()); } public void burnDownOneAp() @@ -176,7 +179,6 @@ public class Player public void turnEnd() { - deploymentDone = (reinforcement.size() == 0); for (Unit unit : units) unit.reset(); } -- cgit v1.1-2-g2b99