From bec2b7ecd1ab5eb48381d9331601bebd832ea289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 5 Feb 2015 12:50:43 +0100 Subject: Unit: add private void updateOverlays() --- core/src/ch/asynk/tankontank/game/Unit.java | 9 +++++++-- 1 file 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); } -- cgit v1.1-2-g2b99