added getters & setters to Tile.x and Tile.y attributes
This commit is contained in:
parent
41b132df46
commit
00fba129e4
@ -8,13 +8,28 @@ public abstract class Tile {
|
||||
protected Map<Direction, Tile> adjacentTile;
|
||||
protected ZPM zpmOnTile;
|
||||
protected Stack<Box> boxStack;
|
||||
protected int x, y;
|
||||
protected int y = -666;
|
||||
protected int x = -666;
|
||||
|
||||
|
||||
public 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) {
|
||||
return adjacentTile.get(direction);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user