From c49788c9d80494e44070f29199517b2da96b61a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 12 Oct 2014 02:00:47 +0200 Subject: Unit: reorder constructors --- core/src/ch/asynk/tankontank/game/Unit.java | 58 +++++++++++++++-------------- 1 file 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; - } } -- cgit v1.1-2-g2b99