From 4f9359bd14d076c455f15e7a6beab4acb66a8028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 5 Oct 2014 10:32:39 +0200 Subject: Unit: implement boolean canAttack(Pawn other) --- core/src/ch/asynk/tankontank/game/Unit.java | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- cgit v1.1-2-g2b99