|
|
| Tile (int row, int col, boolean up, boolean down, boolean left, boolean right) |
| The main constructor of the Tile constructed from (row,column) More...
|
|
| Tile (int id, boolean up, boolean down, boolean left, boolean right) |
| The main constructor of the Tile constructed from tileId. More...
|
|
| Tile (Tile t) |
| A deep copy constructor. More...
|
|
|
Position | position () |
|
Position | position (int row, int col) |
| Set the position of the tile from a (row, column) pair. More...
|
|
Position | position (int tileId) |
| Set the position of the tile from a tileId. More...
|
|
void | setWall (int direction) |
| Sets the tile's wall in the requested direction. More...
|
|
void | clearWall (int direction) |
| Clears the tile's wall in the requested direction. More...
|
|
boolean | hasWall (int direction) |
| Checks if the tile has wall in the requested direction. More...
|
|
int | hasWalls () |
| Checks if the tile has walls and return the number of them. More...
|
|
int | hasSupply (Supply[] supplies) |
| Utility to check if the tile has a supply. More...
|
|
void | pickSupply (Supply[] supplies, int supplyId) |
| Utility to find a supply in the supplies array and removes it. More...
|
|
|
- Note
- Please consider not to use mutator interface. Its the abstraction killer :( We have added a bit of logic however, in order to make it a bit more safe.
|
int | getTileId () |
|
int | getX () |
|
int | getY () |
|
boolean | getUp () |
|
boolean | getDown () |
|
boolean | getLeft () |
|
boolean | getRight () |
|
void | setTileId (int tileId) |
|
void | setX (int x) |
|
void | setY (int y) |
|
void | setUp (boolean up) |
|
void | setDown (boolean down) |
|
void | setRight (boolean right) |
|
void | setLeft (boolean left) |
|
This class is the representation of the board's tile.
Tiles are arranged on the board in square shape and they're identified by an ID. This ID is the linear combination of x and y coordinate of the tile.
Definition at line 19 of file Tile.java.