diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-01-05 10:09:58 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-01-05 10:09:58 +0100 |
commit | 917441a182f1deb7651deb6b2d90d2d5fb64ce1f (patch) | |
tree | c2c67ea04d49eece17c1cf572f219ba02842c73f /core/src | |
parent | 43f197b502ea07861a0f31285118d90a3bf0dc3e (diff) | |
download | RustAndDust-917441a182f1deb7651deb6b2d90d2d5fb64ce1f.zip RustAndDust-917441a182f1deb7651deb6b2d90d2d5fb64ce1f.tar.gz |
Player: add boolean canDoSomething()
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Player.java | 11 |
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)); |