summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-28 16:12:10 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-28 16:12:10 +0100
commit3684b17fb5a8c3ccf725526f446ee90cd94a3406 (patch)
tree277e1cd4f8756aa07e0150cbd95b042e5bae7244 /core/src/ch/asynk/tankontank
parent8504bb5c9999983610a6c63d8e8fdb2b00d45825 (diff)
downloadRustAndDust-3684b17fb5a8c3ccf725526f446ee90cd94a3406.zip
RustAndDust-3684b17fb5a8c3ccf725526f446ee90cd94a3406.tar.gz
Map: add 'Hex getHexAt(float x, float y)'
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java5
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateCommon.java6
2 files changed, 7 insertions, 4 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 8310788..cdf46ce 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -85,6 +85,11 @@ public abstract class Map extends Board
activatedPawns.clear();
}
+ public Hex getHexAt(float x, float y)
+ {
+ return (Hex) getTileAt(x, y);
+ }
+
public Hex getHex(int col, int row)
{
return (Hex) getTile(col, row);
diff --git a/core/src/ch/asynk/tankontank/game/states/StateCommon.java b/core/src/ch/asynk/tankontank/game/states/StateCommon.java
index 0ff9ba1..91f0609 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateCommon.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateCommon.java
@@ -77,16 +77,14 @@ public abstract class StateCommon implements State
public boolean downInMap(float x, float y)
{
- // FIXME
- downHex = (Hex) map.getTileAt(x, y);
+ downHex = map.getHexAt(x, y);
if (downHex == null) return false;
return !downHex.isOffMap();
}
public boolean upInMap(float x, float y)
{
- // FIXME
- upHex = (Hex) map.getTileAt(x, y);
+ upHex = map.getHexAt(x, y);
if (upHex == null) return false;
return !upHex.isOffMap();
}