summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/engine
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-31 14:00:15 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-31 14:00:15 +0100
commit139ed593905fee583b4e00b2f41581c7c62bedb1 (patch)
tree7c6883ac0084a7f4c98459bcd6ea9a863b90a9b5 /core/src/ch/asynk/tankontank/engine
parent54e6e148ef490a2a220159c5a527ec0b1f3cda8e (diff)
downloadRustAndDust-139ed593905fee583b4e00b2f41581c7c62bedb1.zip
RustAndDust-139ed593905fee583b4e00b2f41581c7c62bedb1.tar.gz
Board,SearcBoard: setAdjacentTiles(...) is public, directly access Tile.col and Tile.row
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java16
-rw-r--r--core/src/ch/asynk/tankontank/engine/SearchBoard.java2
2 files changed, 9 insertions, 9 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java
index 5a14de6..e446365 100644
--- a/core/src/ch/asynk/tankontank/engine/Board.java
+++ b/core/src/ch/asynk/tankontank/engine/Board.java
@@ -181,14 +181,14 @@ public abstract class Board implements Disposable
return tiles[((col - colOffset)) + (row * cfg.cols)];
}
- private void setAdjacentTiles(Tile tile, Tile tiles[])
+ public void setAdjacentTiles(Tile tile, Tile tiles[])
{
- tiles[0] = getTile((tile.getCol() - 1), (tile.getRow()));
- tiles[1] = getTile((tile.getCol()), (tile.getRow() + 1));
- tiles[2] = getTile((tile.getCol() + 1), (tile.getRow() + 1));
- tiles[3] = getTile((tile.getCol() + 1), (tile.getRow()));
- tiles[4] = getTile((tile.getCol()), (tile.getRow() - 1));
- tiles[5] = getTile((tile.getCol() - 1), (tile.getRow() - 1));
+ tiles[0] = getTile((tile.col - 1), (tile.row));
+ tiles[1] = getTile((tile.col), (tile.row + 1));
+ tiles[2] = getTile((tile.col + 1), (tile.row + 1));
+ tiles[3] = getTile((tile.col + 1), (tile.row));
+ tiles[4] = getTile((tile.col), (tile.row - 1));
+ tiles[5] = getTile((tile.col - 1), (tile.row - 1));
}
protected void addAnimation(Animation a)
@@ -549,7 +549,7 @@ public abstract class Board implements Disposable
public int distance(Tile from, Tile to)
{
- return distance(from.getCol(), from.getRow(), to.getCol(), to.getRow());
+ return distance(from.col, from.row, to.col, to.row);
}
public int distance(int col0, int row0, int col1, int row1)
diff --git a/core/src/ch/asynk/tankontank/engine/SearchBoard.java b/core/src/ch/asynk/tankontank/engine/SearchBoard.java
index f15c444..55e9113 100644
--- a/core/src/ch/asynk/tankontank/engine/SearchBoard.java
+++ b/core/src/ch/asynk/tankontank/engine/SearchBoard.java
@@ -95,7 +95,7 @@ public class SearchBoard
private Node getNode(Tile tile)
{
- return getNode(tile.getCol(), tile.getRow());
+ return getNode(tile.col, tile.row);
}
private Node getNode(int col, int row)