diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-03 12:41:30 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-03 12:41:30 +0100 |
commit | 4bb65b81688601746fe081fc028eba24b23c3f75 (patch) | |
tree | 010ced2e6ce534a6927a728536a2c9f52716b88f /core/src/ch/asynk/rustanddust | |
parent | 53ff99f2aeb795700dfef84286cfed6374fa9ed0 (diff) | |
download | RustAndDust-4bb65b81688601746fe081fc028eba24b23c3f75.zip RustAndDust-4bb65b81688601746fe081fc028eba24b23c3f75.tar.gz |
Unit: add int Unit.id
Diffstat (limited to 'core/src/ch/asynk/rustanddust')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Unit.java | 6 |
1 files changed, 5 insertions, 1 deletions
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() |