summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-30 17:31:00 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-30 17:31:00 +0200
commitb0d3dadc59d25fdd2bc85943c64c68615a074553 (patch)
tree789fad6a5ffe09fd7b2b7b2384b488f68c4fdf1f /core/src/ch/asynk
parenteffb73c13975e3afb2e0bdef1cc4a2763351be90 (diff)
downloadRustAndDust-b0d3dadc59d25fdd2bc85943c64c68615a074553.zip
RustAndDust-b0d3dadc59d25fdd2bc85943c64c68615a074553.tar.gz
Pawn/Unit: add boolean isUnit()
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java1
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java6
2 files changed, 7 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java
index b049b92..be3c04c 100644
--- a/core/src/ch/asynk/tankontank/engine/Pawn.java
+++ b/core/src/ch/asynk/tankontank/engine/Pawn.java
@@ -26,6 +26,7 @@ public abstract class Pawn extends Image implements Disposable
public abstract int getMovementPoints();
public abstract int getRoadMarchBonus();
+ public abstract boolean isUnit();
public abstract boolean isEnemy(Pawn other);
public abstract int getAngleOfAttack();
public abstract int getAttackRangeFrom(Tile tile);
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java
index 59f6d32..9d880fd 100644
--- a/core/src/ch/asynk/tankontank/game/Unit.java
+++ b/core/src/ch/asynk/tankontank/game/Unit.java
@@ -45,6 +45,12 @@ public class Unit extends HeadedPawn
}
@Override
+ public boolean isUnit()
+ {
+ return true;
+ }
+
+ @Override
public boolean isEnemy(Pawn other)
{
return army.isEnemy(((Unit) other).army);