summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Unit.java6
-rw-r--r--core/src/ch/asynk/rustanddust/game/map/Map1Units.java8
-rw-r--r--core/src/ch/asynk/rustanddust/game/states/StateCommon.java2
-rw-r--r--core/src/ch/asynk/rustanddust/game/states/StateMove.java10
-rw-r--r--core/src/ch/asynk/rustanddust/game/states/StateWithdraw.java2
5 files changed, 13 insertions, 15 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Unit.java b/core/src/ch/asynk/rustanddust/game/Unit.java
index ed15d4b..cdbcebc 100644
--- a/core/src/ch/asynk/rustanddust/game/Unit.java
+++ b/core/src/ch/asynk/rustanddust/game/Unit.java
@@ -13,7 +13,7 @@ import ch.asynk.rustanddust.RustAndDust;
public class Unit extends HeadedPawn
{
- public static final int MOVE = 0;
+ public static final int ACTIVEABLE = 0;
public static final int TARGET = 1;
public static final int FIRE = 2;
public static final int MAY_FIRE = 3;
@@ -363,8 +363,8 @@ public class Unit extends HeadedPawn
}
// SHOW / HIDE
- public void showMoveable() { enableOverlay(MOVE, true); }
- public void hideMoveable() { enableOverlay(MOVE, false); }
+ public void showActiveable() { enableOverlay(ACTIVEABLE, true); }
+ public void hideActiveable() { enableOverlay(ACTIVEABLE, false); }
public void showTarget() { enableOverlay(TARGET, true); }
public void hideTarget() { enableOverlay(TARGET, false); }
public void showAttack() { enableOverlay(FIRE, true); }
diff --git a/core/src/ch/asynk/rustanddust/game/map/Map1Units.java b/core/src/ch/asynk/rustanddust/game/map/Map1Units.java
index 7812d50..e779660 100644
--- a/core/src/ch/asynk/rustanddust/game/map/Map1Units.java
+++ b/core/src/ch/asynk/rustanddust/game/map/Map1Units.java
@@ -104,10 +104,10 @@ public abstract class Map1Units extends Map0Hex
public void unitsTargetHide() { unitsShowOverlay(targetUnits, Unit.TARGET, false); }
public void unitsAssistShow() { unitsShowOverlay(assistUnits, Unit.MAY_FIRE, true); }
public void unitsAssistHide() { unitsShowOverlay(assistUnits, Unit.MAY_FIRE, false); unitsShowOverlay(assistUnits, Unit.FIRE, false); }
- public void unitsMoveableShow() { unitsShowOverlay(moveableUnits, Unit.MOVE, true); }
- public void unitsMoveableHide() { unitsShowOverlay(moveableUnits, Unit.MOVE, false); }
- public void unitsBreakThroughShow() { unitsShowOverlay(breakthroughUnits, Unit.MOVE, true); }
- public void unitsBreakThroughHide() { unitsShowOverlay(breakthroughUnits, Unit.MOVE, false); }
+ public void unitsMoveableShow() { unitsShowOverlay(moveableUnits, Unit.ACTIVEABLE, true); }
+ public void unitsMoveableHide() { unitsShowOverlay(moveableUnits, Unit.ACTIVEABLE, false); }
+ public void unitsBreakThroughShow() { unitsShowOverlay(breakthroughUnits, Unit.ACTIVEABLE, true); }
+ public void unitsBreakThroughHide() { unitsShowOverlay(breakthroughUnits, Unit.ACTIVEABLE, false); }
private void unitsShowOverlay(UnitList units, int overlay, boolean on)
{
diff --git a/core/src/ch/asynk/rustanddust/game/states/StateCommon.java b/core/src/ch/asynk/rustanddust/game/states/StateCommon.java
index fdb797c..97aecfc 100644
--- a/core/src/ch/asynk/rustanddust/game/states/StateCommon.java
+++ b/core/src/ch/asynk/rustanddust/game/states/StateCommon.java
@@ -55,7 +55,7 @@ public abstract class StateCommon implements State
if (cfg.showMoves && unit.canMove()) map.movesShow();
if (cfg.showTargets && unit.canEngage()) map.unitsTargetShow();
if (cfg.showMoveAssists && unit.canMove()) map.unitsMoveableShow();
- unit.enableOverlay(Unit.MOVE, false);
+ unit.hideActiveable();
}
protected void hidePossibilities()
diff --git a/core/src/ch/asynk/rustanddust/game/states/StateMove.java b/core/src/ch/asynk/rustanddust/game/states/StateMove.java
index d89ee44..8c3c68e 100644
--- a/core/src/ch/asynk/rustanddust/game/states/StateMove.java
+++ b/core/src/ch/asynk/rustanddust/game/states/StateMove.java
@@ -26,7 +26,6 @@ public class StateMove extends StateCommon
if (prevState == StateType.SELECT) {
// use selectedHex and selectedUnit
activeUnit = selectedUnit;
- activeUnit.showMoveable();
map.pathsInit(activeUnit);
map.collectUpdate(activeUnit);
if (to != null) {
@@ -44,7 +43,7 @@ public class StateMove extends StateCommon
}
}
- activeUnit.enableOverlay(Unit.MOVE, false);
+ activeUnit.hideActiveable();
}
@Override
@@ -54,7 +53,7 @@ public class StateMove extends StateCommon
return;
// hide all but assists : want them when in rotation
- activeUnit.hideMoveable();
+ activeUnit.hideActiveable();
map.movesHide();
map.hexUnselect(activeUnit.getHex());
if (to != null)
@@ -138,17 +137,16 @@ public class StateMove extends StateCommon
if (activeUnit != null ) {
map.hexUnselect(activeUnit.getHex());
if (activeUnit.canMove())
- activeUnit.enableOverlay(Unit.MOVE, true);
+ activeUnit.showActiveable();
}
activeUnit = unit;
+ activeUnit.hideActiveable();
Hex hex = activeUnit.getHex();
map.pathsInit(activeUnit, hex);
- activeUnit.showMoveable();
map.movesHide();
map.movesCollect(activeUnit);
map.movesShow();
map.hexSelect(hex);
- activeUnit.enableOverlay(Unit.MOVE, false);
ctrl.hud.notify(activeUnit.toString(), Position.TOP_CENTER);
checkExit(activeUnit, hex);
}
diff --git a/core/src/ch/asynk/rustanddust/game/states/StateWithdraw.java b/core/src/ch/asynk/rustanddust/game/states/StateWithdraw.java
index ed4251e..a17f58b 100644
--- a/core/src/ch/asynk/rustanddust/game/states/StateWithdraw.java
+++ b/core/src/ch/asynk/rustanddust/game/states/StateWithdraw.java
@@ -58,7 +58,7 @@ public class StateWithdraw extends StateCommon
map.pathsSetExit(exitZone.orientation);
- unit.hideMoveable();
+ unit.hideActiveable();
if (to != null)
map.pathHide(to);
map.movesHide();