diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 16 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/SearchBoard.java | 2 |
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) |