diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 21 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Unit.java | 1 |
2 files changed, 20 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 79a382d..00978b2 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -27,11 +27,24 @@ public abstract class Pawn implements Moveable, Disposable public class Attack { - int distance; Pawn target; + int distance; boolean isClear; boolean isFlank; public String calculus; + + public String toString() + { + return "attack : " + target + " distance:" + distance + " clear:" + isClear + " flank:" + isFlank + " " + calculus; + } + + public void reset() + { + target = null; + distance = 0;; + isClear = false; + isFlank = false; + } } private static final float MOVE_TIME = 0.4f; @@ -69,7 +82,6 @@ public abstract class Pawn implements Moveable, Disposable public abstract void rotate(Orientation o); public abstract void attack(Pawn target); - public abstract void reset(); public abstract void revertLastMove(); protected Pawn() @@ -101,6 +113,11 @@ public abstract class Pawn implements Moveable, Disposable image.dispose(); } + public void reset() + { + attack.reset(); + } + public boolean isEnemy(Faction other) { return faction.isEnemy(other); diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index e604a3b..9bfff7a 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -227,6 +227,7 @@ public class Unit extends HeadedPawn @Override public void reset() { + super.reset(); mpLeft = mp; hasFired = false; hasMoved = false; |