From 4bb65b81688601746fe081fc028eba24b23c3f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 3 Feb 2016 12:41:30 +0100 Subject: Unit: add int Unit.id --- core/src/ch/asynk/rustanddust/game/Unit.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/ch/asynk/rustanddust/game/Unit.java b/core/src/ch/asynk/rustanddust/game/Unit.java index df824d8..6800040 100644 --- a/core/src/ch/asynk/rustanddust/game/Unit.java +++ b/core/src/ch/asynk/rustanddust/game/Unit.java @@ -23,6 +23,8 @@ public class Unit extends HeadedPawn public static final int FLANK_ATTACK_BONUS = 1; + public static int unit_id = 1; + public enum UnitType implements Pawn.PawnType { HARD_TARGET, @@ -57,6 +59,7 @@ public class Unit extends HeadedPawn public int cdef; public int mp; public int mpLeft; + public int id; public UnitCode code; public UnitType type; public boolean hq; @@ -69,7 +72,8 @@ public class Unit extends HeadedPawn super(army, chit, body, turret, overlays); hq = false; ace = false; - + this. id = unit_id; + unit_id += 1; } private void commonSetup() -- cgit v1.1-2-g2b99