From eb7a9137c72d4c1681f7f7aae32e0dabfa83f6e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 25 Sep 2014 22:45:23 +0200 Subject: Pawn, Unit: add getAttackRangeFrom(Tile) --- core/src/ch/asynk/tankontank/engine/Pawn.java | 1 + core/src/ch/asynk/tankontank/game/Unit.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 8ccc77b..27e6303 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -28,6 +28,7 @@ public abstract class Pawn extends Image implements Disposable public abstract int getRoadMarchBonus(); public abstract boolean isEnemy(Pawn other); public abstract int getAngleOfAttack(); + public abstract int getAttackRangeFrom(Tile tile); public Pawn(TextureRegion pawn, TextureAtlas overlays) { diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index 7567307..0a69249 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import ch.asynk.tankontank.engine.Pawn; +import ch.asynk.tankontank.engine.Tile; import ch.asynk.tankontank.engine.HeadedPawn; public class Unit extends HeadedPawn @@ -31,6 +32,12 @@ public class Unit extends HeadedPawn } @Override + public int getAttackRangeFrom(Tile tile) + { + return rng; + } + + @Override public int getAngleOfAttack() { return orientation.getFrontSides(); -- cgit v1.1-2-g2b99