From 694a0da044be8a3e0ff6176bc71fc7eee8016956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 27 Mar 2016 01:07:01 +0100 Subject: Map5Marshal: load/unload Order.activable --- core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java index a12d463..af3cfe6 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java @@ -169,6 +169,12 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal unloadPromoteOrder(json, o.unit); break; } + if (o.activable.size() > 0) { + json.writeArrayStart("a"); + for(Unit u : o.activable) + json.writeValue(u.id); + json.writeArrayEnd(); + } json.writeObjectEnd(); } json.writeArrayEnd(); @@ -369,6 +375,12 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal order = loadPromoteOrder(o); break; } + JsonValue a = o.get("a"); + if (a != null) { + for (int j = 0; j < a.size; j++) { + order.activable.add(findById(a.getInt(j))); + } + } orders.add(order); } } -- cgit v1.1-2-g2b99