diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-16 10:43:23 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-16 10:43:23 +0200 |
commit | eb2fb0f06215ff327269e0824b0df9051c8f814c (patch) | |
tree | 3ee1750b9a8be29485012e37fcd053273aca2249 /core/src/ch | |
parent | 0206a146d6026e9269fbda409e62bab18ae12865 (diff) | |
download | RustAndDust-eb2fb0f06215ff327269e0824b0df9051c8f814c.zip RustAndDust-eb2fb0f06215ff327269e0824b0df9051c8f814c.tar.gz |
add game/Army
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Army.java | 6 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Unit.java | 7 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/UnitFactory.java | 30 |
3 files changed, 26 insertions, 17 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Army.java b/core/src/ch/asynk/tankontank/game/Army.java new file mode 100644 index 0000000..95b06e9 --- /dev/null +++ b/core/src/ch/asynk/tankontank/game/Army.java @@ -0,0 +1,6 @@ +package ch.asynk.tankontank.game; + +public enum Army +{ + GE, US +} diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index 12681ac..aed976e 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -13,11 +13,13 @@ public class Unit extends Pawn public int mp; public boolean hq; public boolean ht; + public Army army; // hard tager - public Unit(boolean hq, int range, int defense, int movementPoints, TextureRegion region, HexMap map) + public Unit(Army army, boolean hq, int range, int defense, int movementPoints, TextureRegion region, HexMap map) { super(region, map); + this.army = army; this.hq = hq; this.rng = range; this.def = defense; @@ -26,9 +28,10 @@ public class Unit extends Pawn } // soft tager - public Unit(boolean hq, int range, int defense, int concealedDefense, int movementPoints, TextureRegion region, HexMap map) + public Unit(Army army, boolean hq, int range, int defense, int concealedDefense, int movementPoints, TextureRegion region, HexMap map) { super(region, map); + this.army = army; this.hq = hq; this.rng = range; this.def = defense; diff --git a/core/src/ch/asynk/tankontank/game/UnitFactory.java b/core/src/ch/asynk/tankontank/game/UnitFactory.java index 513f38f..6c646d1 100644 --- a/core/src/ch/asynk/tankontank/game/UnitFactory.java +++ b/core/src/ch/asynk/tankontank/game/UnitFactory.java @@ -50,49 +50,49 @@ public class UnitFactory Unit u = null; switch(t) { case GE_AT_GUN: - u = new Unit(false, 3, 8, 9, 1, geAtlas.findRegion("at-gun"), map); + u = new Unit(Army.GE, false, 3, 8, 9, 1, geAtlas.findRegion("at-gun"), map); break; case GE_INFANTRY: - u = new Unit(false, 1, 7, 10, 1, geAtlas.findRegion("infantry"), map); + u = new Unit(Army.GE, false, 1, 7, 10, 1, geAtlas.findRegion("infantry"), map); break; case GE_KINGTIGER: - u = new Unit(false, 3, 12, 1, geAtlas.findRegion("kingtiger"), map); + u = new Unit(Army.GE, false, 3, 12, 1, geAtlas.findRegion("kingtiger"), map); break; case GE_PANZER_IV: - u = new Unit(false, 2, 9, 2, geAtlas.findRegion("panzer-iv"), map); + u = new Unit(Army.GE, false, 2, 9, 2, geAtlas.findRegion("panzer-iv"), map); break; case GE_PANZER_IV_HQ: - u = new Unit(true, 2, 9, 2, geAtlas.findRegion("panzer-iv-hq"), map); + u = new Unit(Army.GE, true, 2, 9, 2, geAtlas.findRegion("panzer-iv-hq"), map); break; case GE_TIGER: - u = new Unit(false, 3, 11, 1, geAtlas.findRegion("tiger"), map); + u = new Unit(Army.GE, false, 3, 11, 1, geAtlas.findRegion("tiger"), map); break; case GE_WESPE: - u = new Unit(false, 5, 8, 1, geAtlas.findRegion("wespe"), map); + u = new Unit(Army.GE, false, 5, 8, 1, geAtlas.findRegion("wespe"), map); break; case US_AT_GUN: - u = new Unit(false, 1, 7, 10, 1, usAtlas.findRegion("at-gun"), map); + u = new Unit(Army.US, false, 1, 7, 10, 1, usAtlas.findRegion("at-gun"), map); break; case US_INFANTRY: - u = new Unit(false, 1, 7, 10, 1, usAtlas.findRegion("infantry"), map); + u = new Unit(Army.US, false, 1, 7, 10, 1, usAtlas.findRegion("infantry"), map); break; case US_PERSHING: - u = new Unit(false, 3, 10, 2, usAtlas.findRegion("pershing"), map); + u = new Unit(Army.US, false, 3, 10, 2, usAtlas.findRegion("pershing"), map); break; case US_PERSHING_HQ: - u = new Unit(true, 3, 10, 2, usAtlas.findRegion("pershing-hq"), map); + u = new Unit(Army.US, true, 3, 10, 2, usAtlas.findRegion("pershing-hq"), map); break; case US_PRIEST: - u = new Unit(false, 5, 8, 1, usAtlas.findRegion("priest"), map); + u = new Unit(Army.US, false, 5, 8, 1, usAtlas.findRegion("priest"), map); break; case US_SHERMAN: - u = new Unit(false, 2, 9, 2, usAtlas.findRegion("sherman"), map); + u = new Unit(Army.US, false, 2, 9, 2, usAtlas.findRegion("sherman"), map); break; case US_SHERMAN_HQ: - u = new Unit(true, 2, 9, 2, usAtlas.findRegion("sherman-hq"), map); + u = new Unit(Army.US, true, 2, 9, 2, usAtlas.findRegion("sherman-hq"), map); break; case US_WOLVERINE: - u = new Unit(false, 3, 8, 3, usAtlas.findRegion("wolverine"), map); + u = new Unit(Army.US, false, 3, 8, 3, usAtlas.findRegion("wolverine"), map); break; } |