diff options
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game/map')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/map/Map4Orders.java | 4 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java b/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java index 553834b..e1f08d2 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java @@ -18,6 +18,7 @@ public abstract class Map4Orders extends Map3Animations protected final Battle battle; protected final OrderList orders; + protected int actionId; protected abstract int engagementCost(Engagement e); protected abstract void resolveEngagement(Engagement e); @@ -25,6 +26,7 @@ public abstract class Map4Orders extends Map3Animations { super(game, map, hex); + this.actionId = 0; this.battle = game.ctrl.battle; this.orders = new OrderList(10); } @@ -38,6 +40,7 @@ public abstract class Map4Orders extends Map3Animations Engagement.clearPool(); } + protected void incActionId() { actionId += 1; } protected int ordersSize() { return orders.size(); } protected void ordersClear() { orders.dispose(); } @@ -141,6 +144,7 @@ public abstract class Map4Orders extends Map3Animations } if (r) { + order.actionId = actionId; order.setActivable(activableUnits); orders.add(order); game.ctrl.orderProcessedCb(); diff --git a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java index af3cfe6..d6ecae0 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java @@ -158,6 +158,7 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal for (Order o : orders) { json.writeObjectStart(); json.writeValue("type", o.type); + json.writeValue("aId", o.actionId); switch(o.type) { case MOVE: unloadMoveOrder(json, o.move); @@ -375,6 +376,7 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal order = loadPromoteOrder(o); break; } + order.actionId = o.getInt("aId"); JsonValue a = o.get("a"); if (a != null) { for (int j = 0; j < a.size; j++) { |