diff options
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Order.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/map/Map4Orders.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java | 2 |
3 files changed, 4 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Order.java b/core/src/ch/asynk/rustanddust/game/Order.java index 8ab3b03..0c4aa0c 100644 --- a/core/src/ch/asynk/rustanddust/game/Order.java +++ b/core/src/ch/asynk/rustanddust/game/Order.java @@ -34,6 +34,7 @@ public class Order implements Disposable, Pool.Poolable, Comparable<Unit> return c; } + public int cost; public int actionId; public OrderType type; public Unit unit; diff --git a/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java b/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java index ff0e01f..66855ab 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java @@ -191,6 +191,7 @@ public abstract class Map4Orders extends Map3Animations } if (r && !replay) { + order.cost = ((activatedUnits.size() > 0) ? ((activableUnits.size() > 0) ? 0 : 1) : 0); order.actionId = actionId; order.setActivable(activableUnits); orders.add(order); diff --git a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java index 979f558..96e6290 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java @@ -159,6 +159,7 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal json.writeObjectStart(); json.writeValue("type", o.type); json.writeValue("aId", o.actionId); + json.writeValue("cost", o.cost); switch(o.type) { case MOVE: unloadMoveOrder(json, o.move); @@ -376,6 +377,7 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal order = loadPromoteOrder(o); break; } + order.cost = o.getInt("cost"); order.actionId = o.getInt("aId"); JsonValue a = o.get("a"); if (a != null) { |