summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/engine
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-01-22 09:07:10 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-01-22 09:07:10 +0100
commitb223877a7feb632dfa38cc60c72d1566ae4f8b40 (patch)
tree5e5b60f229e824baace091bd89d8b8f2517b54ef /core/src/ch/asynk/tankontank/engine
parentf6cc188a1b58f65479d86a43255668ddc673aa70 (diff)
downloadRustAndDust-b223877a7feb632dfa38cc60c72d1566ae4f8b40.zip
RustAndDust-b223877a7feb632dfa38cc60c72d1566ae4f8b40.tar.gz
engine.Pawn.Engagement -> engine.Attack
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-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)