summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/gdx/boardgame/boards
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-07-03 17:08:08 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-07-03 17:08:08 +0200
commita6c03e7c812af6da3e4fd799bb47f09366105b1a (patch)
tree7e6a2c331f9e72c2a5694b31f5255b849e9bacac /core/src/ch/asynk/gdx/boardgame/boards
parentadf768f1c0635954b5278a46c6eab7ec9deb357c (diff)
downloadgdx-boardgame-a6c03e7c812af6da3e4fd799bb47f09366105b1a.zip
gdx-boardgame-a6c03e7c812af6da3e4fd799bb47f09366105b1a.tar.gz
isOnMap -> isOnBoard
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame/boards')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/boards/Board.java2
-rw-r--r--core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java26
-rw-r--r--core/src/ch/asynk/gdx/boardgame/boards/SquareBoard.java4
-rw-r--r--core/src/ch/asynk/gdx/boardgame/boards/TriangleBoard.java4
4 files changed, 18 insertions, 18 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/boards/Board.java b/core/src/ch/asynk/gdx/boardgame/boards/Board.java
index 0fde498..7af37f1 100644
--- a/core/src/ch/asynk/gdx/boardgame/boards/Board.java
+++ b/core/src/ch/asynk/gdx/boardgame/boards/Board.java
@@ -13,7 +13,7 @@ public interface Board extends TileKeyGenerator
public int[] getAngles();
public Tile getTile(int x, int y);
- public boolean isOnMap(int x, int y);
+ public boolean isOnBoard(int x, int y);
public void centerOf(int x, int y, Vector2 v);
public void toBoard(float x, float y, Vector2 v);
diff --git a/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java b/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java
index 800953a..18aba17 100644
--- a/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java
+++ b/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java
@@ -99,7 +99,7 @@ public class HexBoard implements Board
@Override public Tile getTile(int x, int y)
{
- return tileProvider.getTile(x, y, isOnMap(x, y));
+ return tileProvider.getTile(x, y, isOnBoard(x, y));
}
@Override public int[] getAngles()
@@ -126,7 +126,7 @@ public class HexBoard implements Board
@Override public int genKey(int x, int y)
{
- if (!isOnMap(x, y)) return -1;
+ if (!isOnBoard(x, y)) return -1;
if (vertical) {
return _genKey(x, y);
} else {
@@ -144,16 +144,16 @@ public class HexBoard implements Board
return i;
}
- @Override public boolean isOnMap(int x, int y)
+ @Override public boolean isOnBoard(int x, int y)
{
if (vertical) {
- return _isOnMap(x, y);
+ return _isOnBoard(x, y);
} else {
- return _isOnMap(y, x);
+ return _isOnBoard(y, x);
}
}
- private boolean _isOnMap(int x, int y)
+ private boolean _isOnBoard(int x, int y)
{
if ((y < 0) || (y >= rows)) return false;
if ((x < ((y + 1) / 2)) || (x >= (cols + (y / 2)))) return false;
@@ -384,7 +384,7 @@ public class HexBoard implements Board
else
x += dx; // right
Tile t = getTile(x, y);
- if (t.isOnMap()) {
+ if (t.isOnBoard()) {
tiles.add(t);
t.blocked = losBlocked;
if (t.blockLos(from, to, d, distance(x0, y0, x, y)))
@@ -398,7 +398,7 @@ public class HexBoard implements Board
if (!q13) x -= dx;
}
t = getTile(x, y);
- if (t.isOnMap()) {
+ if (t.isOnBoard()) {
tiles.add(t);
t.blocked = losBlocked;
if (t.blockLos(from, to, d, distance(x0, y0, x, y)))
@@ -410,7 +410,7 @@ public class HexBoard implements Board
else
x += dx; // diagonal
t = getTile(x, y);
- if (t.isOnMap()) {
+ if (t.isOnBoard()) {
tiles.add(t);
t.blocked = (losBlocked || blocked == 0x03);
if (t.blocked && !contact) {
@@ -541,7 +541,7 @@ public class HexBoard implements Board
from.parent = null;
from.searchCount = searchCount;
- if (from.acc <= 0 || !from.isOnMap())
+ if (from.acc <= 0 || !from.isOnBoard())
return tiles.size();
int roadMarchBonus = piece.roadMarchBonus();
@@ -556,7 +556,7 @@ public class HexBoard implements Board
buildAdjacents(src.x, src.y);
for (int i = 0, j = 0; i < 6; i++, j++) {
final Tile dst = adjacents[i];
- if (!dst.isOnMap()) continue;
+ if (!dst.isOnBoard()) continue;
if (getAngles()[j] == -1) j++;
final Orientation o = Orientation.fromR(getAngles()[j] + aOffset);
@@ -596,7 +596,7 @@ public class HexBoard implements Board
from.parent = null;
from.searchCount = searchCount;
- if (from == to || !from.isOnMap() || !to.isOnMap())
+ if (from == to || !from.isOnBoard() || !to.isOnBoard())
return tiles.size();
int roadMarchBonus = piece.roadMarchBonus();
@@ -612,7 +612,7 @@ public class HexBoard implements Board
buildAdjacents(src.x, src.y);
for (int i = 0, j = 0; i < 6; i++, j++) {
final Tile dst = adjacents[i];
- if (!dst.isOnMap()) continue;
+ if (!dst.isOnBoard()) continue;
if (getAngles()[j] == -1) j++;
final Orientation o = Orientation.fromR(getAngles()[j] + aOffset);
diff --git a/core/src/ch/asynk/gdx/boardgame/boards/SquareBoard.java b/core/src/ch/asynk/gdx/boardgame/boards/SquareBoard.java
index bede2ea..c7fa576 100644
--- a/core/src/ch/asynk/gdx/boardgame/boards/SquareBoard.java
+++ b/core/src/ch/asynk/gdx/boardgame/boards/SquareBoard.java
@@ -40,7 +40,7 @@ public class SquareBoard implements Board
@Override public Tile getTile(int x, int y)
{
- return tileProvider.getTile(x, y, isOnMap(x, y));
+ return tileProvider.getTile(x, y, isOnBoard(x, y));
}
@Override public int[] getAngles() { return angles; }
@@ -64,7 +64,7 @@ public class SquareBoard implements Board
return (y * cols + x);
}
- @Override public boolean isOnMap(int x, int y)
+ @Override public boolean isOnBoard(int x, int y)
{
if (x < 0 || x >= cols || y < 0 || y >= rows) return false;
return true;
diff --git a/core/src/ch/asynk/gdx/boardgame/boards/TriangleBoard.java b/core/src/ch/asynk/gdx/boardgame/boards/TriangleBoard.java
index e23bdec..406089f 100644
--- a/core/src/ch/asynk/gdx/boardgame/boards/TriangleBoard.java
+++ b/core/src/ch/asynk/gdx/boardgame/boards/TriangleBoard.java
@@ -55,7 +55,7 @@ public class TriangleBoard implements Board
@Override public Tile getTile(int x, int y)
{
- return tileProvider.getTile(x, y, isOnMap(x, y));
+ return tileProvider.getTile(x, y, isOnBoard(x, y));
}
@Override public int[] getAngles()
@@ -79,7 +79,7 @@ public class TriangleBoard implements Board
return (y * cols + x);
}
- @Override public boolean isOnMap(int x, int y)
+ @Override public boolean isOnBoard(int x, int y)
{
if (x < 0 || x >= cols || y < 0 || y >= rows) return false;
return true;