summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-14 12:29:46 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-14 12:29:46 +0200
commit870cb69362a5df5532c875f9d79b0201381418b9 (patch)
tree848163028a21375058161ffe0fc61d25629eb7a8 /core/src/ch/asynk/tankontank
parentd40006e88666d6434e06e3fc96906fad6dc73b3a (diff)
downloadRustAndDust-870cb69362a5df5532c875f9d79b0201381418b9.zip
RustAndDust-870cb69362a5df5532c875f9d79b0201381418b9.tar.gz
Unit: add UnitId id
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java29
1 files changed, 26 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java
index 6798aed..a20891b 100644
--- a/core/src/ch/asynk/tankontank/game/Unit.java
+++ b/core/src/ch/asynk/tankontank/game/Unit.java
@@ -12,7 +12,7 @@ public class Unit extends HeadedPawn
{
public static final int DISABLED = 0;
- enum UnitType
+ public enum UnitType
{
HARD_TARGET,
HARD_TARGET_HQ,
@@ -21,11 +21,32 @@ public class Unit extends HeadedPawn
ARTILLERY
}
+ public enum UnitId
+ {
+ GE_AT_GUN,
+ GE_INFANTRY,
+ GE_KINGTIGER,
+ GE_PANZER_IV,
+ GE_PANZER_IV_HQ,
+ GE_TIGER,
+ GE_WESPE,
+
+ US_AT_GUN,
+ US_INFANTRY,
+ US_PERSHING,
+ US_PERSHING_HQ,
+ US_PRIEST,
+ US_SHERMAN,
+ US_SHERMAN_HQ,
+ US_WOLVERINE
+ }
+
public int rng;
public int def;
public int cdef;
public int mp;
public UnitType type;
+ public UnitId id;
public Army army;
private boolean hasMoved;
private boolean hasFired;
@@ -36,20 +57,21 @@ public class Unit extends HeadedPawn
}
// hard tager
- public Unit(Army army, UnitType type, int range, int defense, int movementPoints, TextureAtlas atlas, String unit, String head)
+ public Unit(Army army, UnitId id, UnitType type, int range, int defense, int movementPoints, TextureAtlas atlas, String unit, String head)
{
super(atlas, unit, head);
this.army = army;
this.rng = range;
this.def = defense;
this.mp = movementPoints;
+ this.id = id;
this.type = type;
this.hasMoved = false;
this.hasFired = false;
}
// soft tager
- public Unit(Army army, UnitType type, int range, int defense, int concealedDefense, int movementPoints, TextureAtlas atlas, String unit, String head)
+ public Unit(Army army, UnitId id, UnitType type, int range, int defense, int concealedDefense, int movementPoints, TextureAtlas atlas, String unit, String head)
{
super(atlas, unit, head);
this.army = army;
@@ -57,6 +79,7 @@ public class Unit extends HeadedPawn
this.def = defense;
this.cdef = concealedDefense;
this.mp = movementPoints;
+ this.id = id;
this.type = type;
this.hasMoved = false;
this.hasFired = false;