diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Attack.java | 6 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Attack.java b/core/src/ch/asynk/tankontank/engine/Attack.java index 6bdc9af..bc99b67 100644 --- a/core/src/ch/asynk/tankontank/engine/Attack.java +++ b/core/src/ch/asynk/tankontank/engine/Attack.java @@ -8,6 +8,11 @@ public class Attack public boolean isClear; public boolean isFlank; + public Attack(Pawn attacker) + { + this.attacker = attacker; + } + public String toString() { return String.format("attack : %s -> %s dist:%d clear:%b flank:%b", attacker, target, distance, isClear, isFlank); @@ -15,7 +20,6 @@ public class Attack public void reset() { - attacker = null; target = null; distance = 0;; isClear = false; diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 00965b3..716b66b 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -73,8 +73,7 @@ public abstract class Pawn implements Moveable, Disposable this.prevTile = null; this.position = new Vector3(0f, 0f, 0f); this.prevPosition = new Vector3(0f, 0f, 0f); - this.attack = new Attack(); - this.attack.attacker = this; + this.attack = new Attack(this); } public Pawn(Faction faction, String name, TextureAtlas pawns, TextureAtlas overlays) |