From df43d41c7a3bd5cad7ed45350284bf9fd6b379b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 18 Dec 2014 17:13:20 +0100 Subject: Map: enterBoard() from deployment -> setOnBoard() --- core/src/ch/asynk/tankontank/game/Map.java | 9 ++++++--- core/src/ch/asynk/tankontank/game/battles/BattleTest.java | 2 +- core/src/ch/asynk/tankontank/game/states/StateDeployment.java | 2 +- 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); -- cgit v1.1-2-g2b99