summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-02-05 12:50:43 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-02-05 12:50:43 +0100
commitbec2b7ecd1ab5eb48381d9331601bebd832ea289 (patch)
tree9185428fd3cc73caaee4f2a76f37668b31d0c468 /core
parent6f81f394d79e6ee62703634a9f03979971c921b5 (diff)
downloadRustAndDust-bec2b7ecd1ab5eb48381d9331601bebd832ea289.zip
RustAndDust-bec2b7ecd1ab5eb48381d9331601bebd832ea289.tar.gz
Unit: add private void updateOverlays()
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java
index 23bf351..ff373b0 100644
--- a/core/src/ch/asynk/tankontank/game/Unit.java
+++ b/core/src/ch/asynk/tankontank/game/Unit.java
@@ -292,7 +292,7 @@ public class Unit extends HeadedPawn
public void setMoved()
{
hasMoved = true;
- showHasMoved();
+ updateOverlays();
}
@Override
@@ -317,7 +317,7 @@ public class Unit extends HeadedPawn
{
TankOnTank.debug(engagement.toString());
hasFired = true;
- showHasFired();
+ updateOverlays();
}
@Override
@@ -338,6 +338,11 @@ public class Unit extends HeadedPawn
mpLeft = mp;
}
+ private void updateOverlays()
+ {
+ enableOverlay(HAS_MOVED, !canMove());
+ enableOverlay(HAS_FIRED, !canEngage());
+ }
// SHOW / HIDE
public void showMoveable() { enableOverlay(MOVE, true); }