summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-31 09:26:32 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-31 09:26:32 +0100
commit69525d8238a0b2e04ce2a34f6daac00bd2f2c132 (patch)
tree6d99a1770df06a4b097f0ec24b1d98753da4b135
parentd7e6c5933fe2c02eb54324ad6cec90992e999766 (diff)
downloadRustAndDust-69525d8238a0b2e04ce2a34f6daac00bd2f2c132.zip
RustAndDust-69525d8238a0b2e04ce2a34f6daac00bd2f2c132.tar.gz
Player: get rid of booleam deploymentDone
-rw-r--r--core/src/ch/asynk/rustanddust/game/Player.java10
1 files 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();
}