summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-12-11 16:28:37 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-12-11 16:28:37 +0100
commit53d20ed7bd4b1f5badb658fbb053e47c2bccc5f7 (patch)
treeef5fdc7348a4d3d2a5d4d491dd44d2445a91d061 /core
parent2cd0902108208bf6eabb876c194891ba14151966 (diff)
downloadRustAndDust-53d20ed7bd4b1f5badb658fbb053e47c2bccc5f7.zip
RustAndDust-53d20ed7bd4b1f5badb658fbb053e47c2bccc5f7.tar.gz
Unit: add HAS_FIRED, HAS_MOVED overlay
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java
index 0f94cdd..12cac1f 100644
--- a/core/src/ch/asynk/tankontank/game/Unit.java
+++ b/core/src/ch/asynk/tankontank/game/Unit.java
@@ -19,6 +19,8 @@ public class Unit extends HeadedPawn
public static final int MAY_FIRE = 3;
public static final int ACE = 4;
public static final int HQ = 5;
+ public static final int HAS_FIRED = 6;
+ public static final int HAS_MOVED = 7;
public static final int FLANK_ATTACK_BONUS = 1;
@@ -286,6 +288,7 @@ public class Unit extends HeadedPawn
public void setMoved()
{
hasMoved = true;
+ showHasMoved();
}
@Override
@@ -305,6 +308,7 @@ public class Unit extends HeadedPawn
{
TankOnTank.debug(engagement.toString());
hasFired = true;
+ showHasFired();
}
@Override
@@ -314,6 +318,8 @@ public class Unit extends HeadedPawn
mpLeft = mp;
hasFired = false;
hasMoved = false;
+ hideHasMoved();
+ hideHasFired();
}
@Override
@@ -333,4 +339,8 @@ public class Unit extends HeadedPawn
public void hideAttack() { enableOverlay(FIRE, false); }
public void showAttackAssist() { enableOverlay(MAY_FIRE, true); }
public void hideAttackAssist() { enableOverlay(MAY_FIRE, false); }
+ public void showHasMoved() { enableOverlay(HAS_MOVED, true); }
+ public void hideHasMoved() { enableOverlay(HAS_MOVED, false); }
+ public void showHasFired() { enableOverlay(HAS_FIRED, true); }
+ public void hideHasFired() { enableOverlay(HAS_FIRED, false); }
}