From 3b5a05b292eefeabcd1806e5b6eb90185d5fe915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 27 Mar 2016 01:05:38 +0100 Subject: Order: remove useless unitCode, unitType, unitHex --- core/src/ch/asynk/rustanddust/game/Order.java | 15 ++------------- core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java | 1 - 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/Order.java b/core/src/ch/asynk/rustanddust/game/Order.java index e57aa2e..fc8925a 100644 --- a/core/src/ch/asynk/rustanddust/game/Order.java +++ b/core/src/ch/asynk/rustanddust/game/Order.java @@ -36,9 +36,6 @@ public class Order implements Disposable, Pool.Poolable, Comparable public OrderType type; public Unit unit; - public Unit.UnitCode unitCode; - public Unit.UnitType unitType; - public Hex unitHex; public Move move; public Engagement engagement; @@ -91,27 +88,19 @@ public class Order implements Disposable, Pool.Poolable, Comparable { this.type = OrderType.MOVE; this.move = move; - setUnit(unit); + this.unit = unit; } public void setPromote(Unit unit) { this.type = OrderType.PROMOTE; - setUnit(unit); + this.unit = unit; } public void setEngage(Unit unit, Unit target) { this.type = OrderType.ENGAGE; this.engagement = Engagement.get(unit, target); - setUnit(unit); - } - - private void setUnit(Unit unit) - { this.unit = unit; - this.unitCode = unit.code; - this.unitType = unit.type; - this.unitHex = unit.getHex(); } } diff --git a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java index a961b11..a12d463 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java @@ -394,7 +394,6 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal Move move = Move.get(unit, from, to, orientation, path); Order o = Order.get(); o.setMove(unit, move); - o.unitHex = from; return o; } -- cgit v1.1-2-g2b99