diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-12 02:00:47 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-12 02:00:47 +0200 |
commit | c49788c9d80494e44070f29199517b2da96b61a7 (patch) | |
tree | 130a15092fc352eede066d262c826b2030b4bca6 /core | |
parent | ccffa8b93bcf1a50b2f6e3b84c44c30df1b7e7ff (diff) | |
download | RustAndDust-c49788c9d80494e44070f29199517b2da96b61a7.zip RustAndDust-c49788c9d80494e44070f29199517b2da96b61a7.tar.gz |
Unit: reorder constructors
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Unit.java | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index d33e688..7419a10 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -22,11 +22,38 @@ public class Unit extends HeadedPawn private boolean hasMoved; private boolean hasFired; - public Unit(TextureAtlas atlas, String pawn, String head) + protected Unit(TextureAtlas atlas, String pawn, String head) { super(atlas, pawn, head); - hasMoved = false; - hasFired = false; + } + + // hard tager + public Unit(Army army, boolean hq, int range, int defense, int movementPoints, TextureAtlas atlas, String unit, String head) + { + super(atlas, unit, head); + this.army = army; + this.hq = hq; + this.rng = range; + this.def = defense; + this.mp = movementPoints; + this.ht = true; + this.hasMoved = false; + this.hasFired = false; + } + + // soft tager + public Unit(Army army, boolean hq, int range, int defense, int concealedDefense, int movementPoints, TextureAtlas atlas, String unit, String head) + { + super(atlas, unit, head); + this.army = army; + this.hq = hq; + this.rng = range; + this.def = defense; + this.cdef = concealedDefense; + this.mp = movementPoints; + this.ht = false; + this.hasMoved = false; + this.hasFired = false; } @Override @@ -130,29 +157,4 @@ public class Unit extends HeadedPawn { hasMoved = false; } - - // hard tager - public Unit(Army army, boolean hq, int range, int defense, int movementPoints, TextureAtlas atlas, String unit, String head) - { - super(atlas, unit, head); - this.army = army; - this.hq = hq; - this.rng = range; - this.def = defense; - this.mp = movementPoints; - this.ht = true; - } - - // soft tager - public Unit(Army army, boolean hq, int range, int defense, int concealedDefense, int movementPoints, TextureAtlas atlas, String unit, String head) - { - super(atlas, unit, head); - this.army = army; - this.hq = hq; - this.rng = range; - this.def = defense; - this.cdef = concealedDefense; - this.mp = movementPoints; - this.ht = false; - } } |