summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game/states
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-18 10:40:41 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-18 10:40:41 +0100
commit516e86d9aee3b441f070c46a367d321e5ba4fa5d (patch)
tree06176cbbfdf15455b812b00572e8ad2522df2efe /core/src/ch/asynk/tankontank/game/states
parent7c42ae01f9d0e25a86aa8badf9286d016278224b (diff)
downloadRustAndDust-516e86d9aee3b441f070c46a367d321e5ba4fa5d.zip
RustAndDust-516e86d9aee3b441f070c46a367d321e5ba4fa5d.tar.gz
engine.EntryPoint -> engine.Zone
Diffstat (limited to 'core/src/ch/asynk/tankontank/game/states')
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateDeployment.java26
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java1
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateReinforcement.java24
3 files changed, 26 insertions, 25 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateDeployment.java b/core/src/ch/asynk/tankontank/game/states/StateDeployment.java
index a30d59c..c3944bc 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateDeployment.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateDeployment.java
@@ -1,7 +1,7 @@
package ch.asynk.tankontank.game.states;
import ch.asynk.tankontank.engine.Orientation;
-import ch.asynk.tankontank.engine.EntryPoint;
+import ch.asynk.tankontank.engine.Zone;
import ch.asynk.tankontank.engine.PawnSet;
import ch.asynk.tankontank.game.Hex;
import ch.asynk.tankontank.game.Unit;
@@ -12,7 +12,7 @@ import ch.asynk.tankontank.TankOnTank;
public class StateDeployment extends StateCommon
{
private boolean done;
- private EntryPoint entryPoint;
+ private Zone entryZone;
private PawnSet deployedUnits = new PawnSet(map, 10);
@Override
@@ -21,7 +21,7 @@ public class StateDeployment extends StateCommon
if (selectedHex != null)
map.unselectHex(selectedHex);
done = false;
- entryPoint = null;
+ entryZone = null;
selectedHex = null;
ctrl.hud.actionButtons.hide();
ctrl.hud.playerInfo.unitDock.show();
@@ -33,8 +33,8 @@ public class StateDeployment extends StateCommon
{
if (selectedHex != null)
map.unselectHex(selectedHex);
- if (entryPoint != null)
- entryPoint.enable(Hex.AREA, false);
+ if (entryZone != null)
+ entryZone.enable(Hex.AREA, false);
ctrl.hud.playerInfo.unitDock.hide();
}
@@ -68,8 +68,8 @@ public class StateDeployment extends StateCommon
Orientation o = Orientation.fromAdj(selectedHex, upHex);
if (o != Orientation.KEEP)
doRotation(o);
- } else if (!done && (entryPoint != null) && (upHex != null)) {
- if (upHex.isEmpty() && entryPoint.contains(upHex))
+ } else if (!done && (entryZone != null) && (upHex != null)) {
+ if (upHex.isEmpty() && entryZone.contains(upHex))
unitEnter(activeUnit);
} else {
unit = downHex.getUnit();
@@ -84,9 +84,9 @@ public class StateDeployment extends StateCommon
private void changeUnit(Unit unit)
{
activeUnit = unit;
- if (entryPoint != null) entryPoint.enable(Hex.AREA, false);
- entryPoint = ctrl.battle.getEntryPoint(activeUnit);
- entryPoint.enable(Hex.AREA, true);
+ if (entryZone != null) entryZone.enable(Hex.AREA, false);
+ entryZone = ctrl.battle.getEntryZone(activeUnit);
+ entryZone.enable(Hex.AREA, true);
}
private void undo()
@@ -105,9 +105,9 @@ public class StateDeployment extends StateCommon
selectedUnit = unit;
selectedHex = upHex;
ctrl.player.unitEntry(unit);
- map.enterBoard(unit, upHex, entryPoint.orientation);
+ map.enterBoard(unit, upHex, entryZone.orientation);
deployedUnits.add(unit);
- entryPoint.enable(Hex.AREA, false);
+ entryZone.enable(Hex.AREA, false);
showRotation();
ctrl.hud.update();
}
@@ -128,7 +128,7 @@ public class StateDeployment extends StateCommon
selectedUnit.setRotation(o.r());
ctrl.hud.actionButtons.hide();
ctrl.hud.playerInfo.unitDock.show();
- entryPoint = null;
+ entryZone = null;
activeUnit = null;
selectedUnit = null;
if (ctrl.checkDeploymentDone()) {
diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java
index 3d3dbe0..a6747d0 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateMove.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java
@@ -1,5 +1,6 @@
package ch.asynk.tankontank.game.states;
+import ch.asynk.tankontank.engine.Zone;
import ch.asynk.tankontank.game.Hex;
import ch.asynk.tankontank.game.Unit;
import ch.asynk.tankontank.game.hud.ActionButtons.Buttons;
diff --git a/core/src/ch/asynk/tankontank/game/states/StateReinforcement.java b/core/src/ch/asynk/tankontank/game/states/StateReinforcement.java
index 33668db..634ee00 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateReinforcement.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateReinforcement.java
@@ -1,13 +1,13 @@
package ch.asynk.tankontank.game.states;
-import ch.asynk.tankontank.engine.EntryPoint;
+import ch.asynk.tankontank.engine.Zone;
import ch.asynk.tankontank.game.Hex;
import ch.asynk.tankontank.game.Unit;
import ch.asynk.tankontank.game.hud.ActionButtons.Buttons;
public class StateReinforcement extends StateCommon
{
- private EntryPoint entryPoint;
+ private Zone entryZone;
@Override
public void enter(StateType prevState)
@@ -15,7 +15,7 @@ public class StateReinforcement extends StateCommon
map.clearAll();
if (selectedHex != null)
map.unselectHex(selectedHex);
- entryPoint = null;
+ entryZone = null;
selectedHex = null;
ctrl.hud.playerInfo.unitDock.show();
}
@@ -25,8 +25,8 @@ public class StateReinforcement extends StateCommon
{
if (selectedHex != null)
map.unselectHex(selectedHex);
- if (entryPoint != null)
- entryPoint.enable(Hex.AREA, false);
+ if (entryZone != null)
+ entryZone.enable(Hex.AREA, false);
ctrl.hud.playerInfo.unitDock.hide();
}
@@ -53,7 +53,7 @@ public class StateReinforcement extends StateCommon
Unit unit = ctrl.hud.playerInfo.unitDock.selectedUnit;
if ((unit != null) && (unit != activeUnit))
changeUnit(unit);
- else if ((entryPoint != null) && upHex.isEmpty() && entryPoint.contains(upHex))
+ else if ((entryZone != null) && upHex.isEmpty() && entryZone.contains(upHex))
unitEnter(activeUnit);
else
ctrl.setState(StateType.SELECT);
@@ -62,10 +62,10 @@ public class StateReinforcement extends StateCommon
private void changeUnit(Unit unit)
{
activeUnit = unit;
- if (entryPoint != null)
- entryPoint.enable(Hex.AREA, false);
- entryPoint = ctrl.battle.getEntryPoint(activeUnit);
- entryPoint.enable(Hex.AREA, true);
+ if (entryZone != null)
+ entryZone.enable(Hex.AREA, false);
+ entryZone = ctrl.battle.getEntryZone(activeUnit);
+ entryZone.enable(Hex.AREA, true);
ctrl.hud.actionButtons.show(((ctrl.cfg.canCancel) ? Buttons.ABORT.b : 0));
}
@@ -74,9 +74,9 @@ public class StateReinforcement extends StateCommon
selectedUnit = unit;
selectedHex = upHex;
map.selectHex(selectedHex);
- entryPoint.enable(Hex.AREA, false);
+ entryZone.enable(Hex.AREA, false);
ctrl.player.unitEntry(unit);
- if (map.enterBoard(unit, upHex, entryPoint.allowedMoves)) {
+ if (map.enterBoard(unit, upHex, entryZone.allowedMoves)) {
if (unit.getMovementPoints() > 0)
ctrl.setState(StateType.MOVE);
else