diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-18 17:13:20 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-18 17:13:20 +0100 |
commit | df43d41c7a3bd5cad7ed45350284bf9fd6b379b1 (patch) | |
tree | e4b6c410d3c22eaa782dd3b39fd1ec480a55efb2 | |
parent | 66f490fedf3545bc0a239d466d85d3d1a71feac6 (diff) | |
download | RustAndDust-df43d41c7a3bd5cad7ed45350284bf9fd6b379b1.zip RustAndDust-df43d41c7a3bd5cad7ed45350284bf9fd6b379b1.tar.gz |
Map: enterBoard() from deployment -> setOnBoard()
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 9 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/battles/BattleTest.java | 2 | ||||
-rw-r--r-- | 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); |