summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-05 10:32:39 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-05 10:32:39 +0200
commit4f9359bd14d076c455f15e7a6beab4acb66a8028 (patch)
treec9f77fa4b526ebabcfc0e4221f6992ffd5c7e511 /core
parenta61c81b59c78a3066113da328f9cb42b3022f187 (diff)
downloadRustAndDust-4f9359bd14d076c455f15e7a6beab4acb66a8028.zip
RustAndDust-4f9359bd14d076c455f15e7a6beab4acb66a8028.tar.gz
Unit: implement boolean canAttack(Pawn other)
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java
index 64eb0c0..0ececb2 100644
--- a/core/src/ch/asynk/tankontank/game/Unit.java
+++ b/core/src/ch/asynk/tankontank/game/Unit.java
@@ -56,6 +56,12 @@ public class Unit extends HeadedPawn
return army.isEnemy(((Unit) other).army);
}
+ @Override
+ public boolean canAttack(Pawn other)
+ {
+ return isEnemy(other);
+ }
+
// hard tager
public Unit(Army army, boolean hq, int range, int defense, int movementPoints, TextureAtlas atlas, String unit, String head)
{