summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/game
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Unit.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Unit.java b/core/src/ch/asynk/rustanddust/game/Unit.java
index a55c7b3..7a9f2e2 100644
--- a/core/src/ch/asynk/rustanddust/game/Unit.java
+++ b/core/src/ch/asynk/rustanddust/game/Unit.java
@@ -132,6 +132,17 @@ public class Unit extends HeadedPawn
return ace;
}
+ public void spendMovementPoints(int n)
+ {
+ mpLeft -= n;
+ }
+
+ @Override
+ public int getSpentMovementPoints()
+ {
+ return (mp - mpLeft);
+ }
+
@Override
public int getMovementPoints()
{
@@ -307,7 +318,7 @@ public class Unit extends HeadedPawn
if ((cost > 0) && move.isFinal())
setMoved();
- mpLeft -= cost;
+ spendMovementPoints(cost);
}
@Override