summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/gdx/boardgame
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-06-02 12:30:13 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-06-02 12:30:13 +0200
commitf90c02f54895ca34cdc3b391587435262a66a3ec (patch)
tree92eb7fff5cca80de5aa36ee419ce16a47476d4d4 /core/src/ch/asynk/gdx/boardgame
parent79ad42791c668026834cc290e3a285e1af10cb44 (diff)
downloadgdx-boardgame-f90c02f54895ca34cdc3b391587435262a66a3ec.zip
gdx-boardgame-f90c02f54895ca34cdc3b391587435262a66a3ec.tar.gz
Tile : add isOnMap() and Tile.OffMap
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/Tile.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Tile.java b/core/src/ch/asynk/gdx/boardgame/Tile.java
index 36dcf32..077a796 100644
--- a/core/src/ch/asynk/gdx/boardgame/Tile.java
+++ b/core/src/ch/asynk/gdx/boardgame/Tile.java
@@ -10,25 +10,39 @@ public class Tile implements Drawable
{
public static TextureAtlas defaultOverlay = null;
+ public static final Tile OffMap = new Tile(Integer.MIN_VALUE, Integer.MIN_VALUE, 0f, 0f, false);
+
public int x;
public int y;
public float cx;
public float cy;
public boolean blocked;
+ public boolean onMap;
private Overlays overlays;
public Tile(int x, int y, float cx, float cy)
{
+ this(x, y, cx, cy, true);
+ }
+
+ public Tile(int x, int y, float cx, float cy, boolean onMap)
+ {
this.x = x;
this.y = y;
this.cx = cx;
this.cy = cy;
+ this.onMap = onMap;
this.blocked = false;
if (defaultOverlay != null) {
setOverlay(defaultOverlay);
}
}
+ public boolean isOnMap()
+ {
+ return onMap;
+ }
+
public boolean blockLos(final Tile from, final Tile to)
{
return false;