diff options
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Order.java | 4 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/map/Map4Orders.java | 14 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Order.java b/core/src/ch/asynk/rustanddust/game/Order.java index 0c4aa0c..1272c4d 100644 --- a/core/src/ch/asynk/rustanddust/game/Order.java +++ b/core/src/ch/asynk/rustanddust/game/Order.java @@ -35,7 +35,7 @@ public class Order implements Disposable, Pool.Poolable, Comparable<Unit> } public int cost; - public int actionId; + public int orderId; public OrderType type; public Unit unit; public Move move; @@ -85,7 +85,7 @@ public class Order implements Disposable, Pool.Poolable, Comparable<Unit> @Override public String toString() { - return String.format("%s : %s", type, unit.code); + return String.format("[%d] %s : %s", orderId, type, unit.code); } public void setMove(Unit unit, Move move) diff --git a/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java b/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java index 1403e6a..3a48e4c 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java @@ -17,7 +17,7 @@ public abstract class Map4Orders extends Map3Animations protected final OrderList orders; protected final OrderList replayOrders; - protected int actionId; + protected int orderId; protected abstract int engagementCost(Engagement e); protected abstract void resolveEngagement(Engagement e); @@ -25,7 +25,7 @@ public abstract class Map4Orders extends Map3Animations { super(game, map, hex); - this.actionId = 0; + this.orderId = 0; this.orders = new OrderList(10); this.replayOrders = new OrderList(10); } @@ -39,7 +39,7 @@ public abstract class Map4Orders extends Map3Animations Engagement.clearPool(); } - protected void incActionId() { actionId += 1; } + protected void incOrderId() { orderId += 1; } protected int ordersSize() { return orders.size(); } protected void ordersClear() { orders.dispose(); } @@ -120,11 +120,11 @@ public abstract class Map4Orders extends Map3Animations public void prepareReplayLastAction() { int s = orders.size(); - int a = orders.get(s - 1).actionId; + int a = orders.get(s - 1).orderId; while (s > 0) { s -= 1; Order o = orders.get(s); - if (o.actionId != a) + if (o.orderId != a) break; replayOrders.add(o); } @@ -188,7 +188,7 @@ public abstract class Map4Orders extends Map3Animations } if (r && !replay) { - order.actionId = actionId; + order.orderId = orderId; order.setActivable(activableUnits); order.cost = ((activatedUnits.size() > 0) ? ((activableUnits.size() > 0) ? 0 : 1) : 0); orders.add(order); @@ -199,7 +199,7 @@ public abstract class Map4Orders extends Map3Animations activableUnits.clear(); for (Unit u : order.activable) activableUnits.add(u); - actionId = order.actionId; + orderId = order.orderId; } return r; diff --git a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java index 5f4118d..4214d7e 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java @@ -158,7 +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); + json.writeValue("oId", o.orderId); json.writeValue("cost", o.cost); switch(o.type) { case MOVE: @@ -378,7 +378,7 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal break; } order.cost = o.getInt("cost"); - order.actionId = o.getInt("aId"); + order.orderId = o.getInt("oId"); JsonValue a = o.get("a"); if (a != null) { for (int j = 0; j < a.size; j++) { |