summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-01-19 17:27:56 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-01-19 17:27:56 +0100
commit3b5a424fdf4e8963ab218775e35f60a36da2bc28 (patch)
tree395dedbef318e30fd902143d480612c051f0dbaa /core/src
parent050015f59e3f30980d2e09ad2e0057867c068031 (diff)
downloadRustAndDust-3b5a424fdf4e8963ab218775e35f60a36da2bc28.zip
RustAndDust-3b5a424fdf4e8963ab218775e35f60a36da2bc28.tar.gz
Map: move player.blah calls from States -> Map
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java3
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateDeployment.java1
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateEscape.java4
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateReinforcement.java1
4 files changed, 4 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index cb22baf..f5a9355 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -271,16 +271,19 @@ public abstract class Map extends Board
case EXIT:
initMove(unit);
movePawn(unit, move, notifyDoneAnimation(unit), objectives);
+ ctrl.player.unitEscape(unit);
r = moveableUnits.size();
break;
case SET:
// FIXME SET -> activatedUnits.add(unit); ??
setPawnOnto(unit, move);
+ ctrl.player.unitEntry(unit);
objectives.claim((Hex) move.to, unit.getArmy());
break;
case ENTER:
// FIXME ENTER -> activatedUnits.add(unit); ??
enterPawn(unit, move);
+ ctrl.player.unitEntry(unit);
objectives.claim((Hex) move.to, unit.getArmy());
break;
default:
diff --git a/core/src/ch/asynk/tankontank/game/states/StateDeployment.java b/core/src/ch/asynk/tankontank/game/states/StateDeployment.java
index 061411f..c3a333e 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateDeployment.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateDeployment.java
@@ -100,7 +100,6 @@ public class StateDeployment extends StateCommon
{
selectedUnit = unit;
selectedHex = upHex;
- ctrl.player.unitEntry(unit);
map.setOnBoard(unit, upHex, entryZone.orientation);
deployedUnits.add(unit);
entryZone.enable(Hex.AREA, false);
diff --git a/core/src/ch/asynk/tankontank/game/states/StateEscape.java b/core/src/ch/asynk/tankontank/game/states/StateEscape.java
index 2d8eefd..4a6cd13 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateEscape.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateEscape.java
@@ -63,9 +63,7 @@ public class StateEscape extends StateCommon
unit.hideMoveable();
map.hidePath(to);
map.hidePossibleMoves();
- map.unselectHex(unit.getHex());
-
- ctrl.player.unitEscape(unit);
+ map.unselectHex(hex);
if (map.exitBoard(unit) > 0)
return StateType.MOVE;
diff --git a/core/src/ch/asynk/tankontank/game/states/StateReinforcement.java b/core/src/ch/asynk/tankontank/game/states/StateReinforcement.java
index 792c159..3ac5c95 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateReinforcement.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateReinforcement.java
@@ -75,7 +75,6 @@ public class StateReinforcement extends StateCommon
selectedHex = upHex;
map.selectHex(selectedHex);
entryZone.enable(Hex.AREA, false);
- ctrl.player.unitEntry(unit);
if (map.enterBoard(unit, upHex, entryZone.allowedMoves)) {
if (unit.getMovementPoints() > 0)
ctrl.setState(StateType.MOVE);