summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-25 22:45:23 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-25 22:45:23 +0200
commiteb7a9137c72d4c1681f7f7aae32e0dabfa83f6e3 (patch)
tree4c627a46e8ff45ebfef473bddd0b0f9bf2b0458c /core/src/ch/asynk/tankontank
parent819e9b740d7420838067a23383c6252df3024b92 (diff)
downloadRustAndDust-eb7a9137c72d4c1681f7f7aae32e0dabfa83f6e3.zip
RustAndDust-eb7a9137c72d4c1681f7f7aae32e0dabfa83f6e3.tar.gz
Pawn, Unit: add getAttackRangeFrom(Tile)
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java1
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java7
2 files changed, 8 insertions, 0 deletions
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();