From 139ed593905fee583b4e00b2f41581c7c62bedb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 31 Oct 2014 14:00:15 +0100 Subject: Board,SearcBoard: setAdjacentTiles(...) is public, directly access Tile.col and Tile.row --- core/src/ch/asynk/tankontank/engine/Board.java | 16 ++++++++-------- 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) -- cgit v1.1-2-g2b99