From 4712d9d3c617dbd146d4c84f65f64c1dd3c89750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 7 Apr 2016 12:01:18 +0200 Subject: Map: enable exit Zone when adding it to the map --- core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java | 1 - core/src/ch/asynk/rustanddust/game/map/Map0Hex.java | 1 + core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java index 975cc46..e88600c 100644 --- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java +++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java @@ -227,7 +227,6 @@ public abstract class BattleCommon implements Battle protected void addExitZone(Zone exit) { map.addExitZone(exit); - exit.enable(Hex.EXIT, true); } protected void addReinforcement(Player player, Zone entryZone, UnitCode unitCode) diff --git a/core/src/ch/asynk/rustanddust/game/map/Map0Hex.java b/core/src/ch/asynk/rustanddust/game/map/Map0Hex.java index 95e56ae..9b44bed 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map0Hex.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map0Hex.java @@ -79,6 +79,7 @@ public abstract class Map0Hex extends Board public void addExitZone(Zone zone) { exitZones.add(zone); + zone.enable(Hex.EXIT, true); } public void hexSelect(Hex hex) { selectedTile.set(hex); } diff --git a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java index 38151b8..d73308f 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java @@ -342,10 +342,10 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal } a = v.get("e"); for (int i = 0; i < a.size; i++) - entryZones.add(loadZone(a.get(i))); + addEntryZone(loadZone(a.get(i))); a = v.get("x"); for (int i = 0; i < a.size; i++) - exitZones.add(loadZone(a.get(i))); + addExitZone(loadZone(a.get(i))); } private Zone loadZone(JsonValue v) -- cgit v1.1-2-g2b99