summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java9
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/BattleTest.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateDeployment.java2
3 files changed, 8 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 12ee01f..6ccffce 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -267,12 +267,15 @@ public abstract class Map extends Board
Orientation entry = findBestEntry(unit, to, allowedMoves);
if (entry == Orientation.KEEP)
return false;
- return enterBoard(unit, to, entry);
+ unit.enterBoard(to, entry);
+ setPawnOnto(unit, to, entry);
+ objectives.claim(to, unit.getArmy());
+ return true;
}
- public boolean enterBoard(Unit unit, Hex to, Orientation entry)
+ public boolean setOnBoard(Unit unit, Hex to, Orientation entry)
{
- unit.enterBoard(to, entry);
+ TankOnTank.debug("Map", String.format("set %s %s %s", to.toShort(), unit, entry));
setPawnOnto(unit, to, entry);
objectives.claim(to, unit.getArmy());
return true;
diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleTest.java b/core/src/ch/asynk/tankontank/game/battles/BattleTest.java
index dd73c66..ebeea53 100644
--- a/core/src/ch/asynk/tankontank/game/battles/BattleTest.java
+++ b/core/src/ch/asynk/tankontank/game/battles/BattleTest.java
@@ -72,7 +72,7 @@ public class BattleTest extends BattleCommon
{
Unit u = factory.getUnit(unitId);
player.addUnit(u);
- map.enterBoard(u, map.getHex(col, row), orientation);
+ map.setOnBoard(u, map.getHex(col, row), orientation);
return u;
}
diff --git a/core/src/ch/asynk/tankontank/game/states/StateDeployment.java b/core/src/ch/asynk/tankontank/game/states/StateDeployment.java
index b2359cd..2c966e0 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateDeployment.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateDeployment.java
@@ -101,7 +101,7 @@ public class StateDeployment extends StateCommon
selectedUnit = unit;
selectedHex = upHex;
ctrl.player.unitEntry(unit);
- map.enterBoard(unit, upHex, entryZone.orientation);
+ map.setOnBoard(unit, upHex, entryZone.orientation);
deployedUnits.add(unit);
entryZone.enable(Hex.AREA, false);
showRotation(unit, upHex);