summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Attack.java24
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java25
2 files changed, 27 insertions, 22 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Attack.java b/core/src/ch/asynk/tankontank/engine/Attack.java
new file mode 100644
index 0000000..2ec5e09
--- /dev/null
+++ b/core/src/ch/asynk/tankontank/engine/Attack.java
@@ -0,0 +1,24 @@
+package ch.asynk.tankontank.engine;
+
+public class Attack
+{
+ Pawn assaulter;
+ Pawn target;
+ int distance;
+ boolean isClear;
+ boolean isFlank;
+
+ public String toString()
+ {
+ return "engage : " + assaulter + " " + target + " distance:" + distance + " clear:" + isClear + " flank:" + isFlank;
+ }
+
+ public void reset()
+ {
+ assaulter = null;
+ target = null;
+ distance = 0;;
+ isClear = false;
+ isFlank = false;
+ }
+}
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java
index a2e6951..f609fb9 100644
--- a/core/src/ch/asynk/tankontank/engine/Pawn.java
+++ b/core/src/ch/asynk/tankontank/engine/Pawn.java
@@ -29,27 +29,6 @@ public abstract class Pawn implements Moveable, Disposable
{
}
- public class Engagement
- {
- Pawn target;
- int distance;
- boolean isClear;
- boolean isFlank;
-
- public String toString()
- {
- return "engage : " + target + " distance:" + distance + " clear:" + isClear + " flank:" + isFlank;
- }
-
- public void reset()
- {
- target = null;
- distance = 0;;
- isClear = false;
- isFlank = false;
- }
- }
-
private static final float MOVE_TIME = 0.4f;
private Vector3 position;
@@ -60,7 +39,7 @@ public abstract class Pawn implements Moveable, Disposable
protected String descr;
private Sprite sprite;
private StackedImages overlays;
- public Engagement engagement = new Engagement();
+ protected Attack engagement;
protected Move move;
public abstract int getMovementPoints();
@@ -94,6 +73,8 @@ 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.engagement = new Attack();
+ this.engagement.assaulter = this;
}
public Pawn(Faction faction, String name, TextureAtlas pawns, TextureAtlas overlays)