added getters & setters to Tile.x and Tile.y attributes

This commit is contained in:
Kjistóf 2016-04-25 21:33:09 +02:00
parent 41b132df46
commit 00fba129e4

View File

@ -8,13 +8,28 @@ public abstract class Tile {
protected Map<Direction, Tile> adjacentTile; protected Map<Direction, Tile> adjacentTile;
protected ZPM zpmOnTile; protected ZPM zpmOnTile;
protected Stack<Box> boxStack; protected Stack<Box> boxStack;
protected int x, y; protected int y = -666;
protected int x = -666;
public Tile() { public Tile() {
adjacentTile = new HashMap<Direction, Tile>(); adjacentTile = new HashMap<Direction, Tile>();
} }
public int getX() { return this.x; }
public int getY() { return this.y; }
public void setX(int x) {
if (x >= 0)
this.x = x;
}
public void setY(int y) {
if (y >= 0)
this.y = y;
}
public Tile getAdjacentTile(Direction direction) { public Tile getAdjacentTile(Direction direction) {
return adjacentTile.get(direction); return adjacentTile.get(direction);
} }