diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-15 16:41:08 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-15 16:41:08 +0100 |
commit | d4a2b34687c0a81596cd8d5b7c882e9b935c384d (patch) | |
tree | f92b7b6eda03789c511ba011bd77943c5cf493e3 /core | |
parent | 7fcb5662cb51d3c75d3a744102bd30a033665948 (diff) | |
download | RustAndDust-d4a2b34687c0a81596cd8d5b7c882e9b935c384d.zip RustAndDust-d4a2b34687c0a81596cd8d5b7c882e9b935c384d.tar.gz |
Unit: add setMoved() to mark it unconditionally
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Unit.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index 7ff3720..f7369f6 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -199,15 +199,20 @@ public class Unit extends HeadedPawn return (isEnemy(other) && canEngage()); } + public void setMoved() + { + hasMoved = true; + } + @Override public void move() { TankOnTank.debug(movement.toString()); if (movement.cost > mpLeft) TankOnTank.debug("ERROR: Movement point exceeded: " + movement.cost + "/" + mpLeft + " please report"); - if (movement.isComplete()) { - hasMoved = true; - } + if (movement.isComplete()) + setMoved(); + mpLeft -= movement.cost; } |