summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-05 10:09:58 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-05 10:09:58 +0100
commit917441a182f1deb7651deb6b2d90d2d5fb64ce1f (patch)
treec2c67ea04d49eece17c1cf572f219ba02842c73f /core/src/ch
parent43f197b502ea07861a0f31285118d90a3bf0dc3e (diff)
downloadRustAndDust-917441a182f1deb7651deb6b2d90d2d5fb64ce1f.zip
RustAndDust-917441a182f1deb7651deb6b2d90d2d5fb64ce1f.tar.gz
Player: add boolean canDoSomething()
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Player.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Player.java b/core/src/ch/asynk/rustanddust/game/Player.java
index de8be76..4018307 100644
--- a/core/src/ch/asynk/rustanddust/game/Player.java
+++ b/core/src/ch/asynk/rustanddust/game/Player.java
@@ -148,6 +148,17 @@ public class Player
return (apSpent == actionPoints);
}
+ public boolean canDoSomething()
+ {
+ if (reinforcement() > 0)
+ return true;
+ for (Unit unit : units) {
+ if (unit.canMove() || unit.canEngage() || canPromote(unit))
+ return true;
+ }
+ return false;
+ }
+
public boolean isDeploymentDone()
{
return (deploymentDone || (reinforcement.size() == 0));