Labyrinth
A labyrinth game assignment
|
This class is the representation of the supplies in the game. More...
Package Functions | |
Constructors | |
Supply (int id, int row, int col) | |
The main constructor of the Supply constructed from (row,column) More... | |
Supply (int id, int tileId) | |
A second constructor of the Supply constructed from supplyTileId. More... | |
Supply (Supply s) | |
A deep copy constructor. More... | |
Supply's main application interface | |
int | supplyId () |
int | supplyId (int sID) |
Set the supplyId. More... | |
Position | position () |
Position | position (int row, int col) |
Set the position of the supply from a (row, column) pair. More... | |
Position | position (int tileId) |
Set the position of the supply from a tileId. More... | |
void | removeSupply () |
Marks the supply removed. More... | |
Accessor/Mutator interface | |
| |
int | getSupplyId () |
int | getX () |
int | getY () |
int | getSupplyTileId () |
void | setSupplyId (int Id) |
void | setX (int x) |
void | setY (int y) |
void | setSupplyTileId (int tileId) |
Private Attributes | |
Class data | |
int | supplyId |
The unique identifier of the tile. More... | |
int | x |
The x coordinate of the tile as if the board lies in the 1st quadrant. More... | |
int | y |
The y coordinate of the tile as if the board lies in the 1st quadrant. More... | |
int | supplyTileId |
The Id of the tile on the board, in witch the supply is located. More... | |
This class is the representation of the supplies in the game.
Supplies are the game "goodies". They placed randomly in the board. In each tile there can be only one supply. The player has to collect all of them in order to complete the game successfully.
Definition at line 23 of file Supply.java.
|
package |
The main constructor of the Supply constructed from (row,column)
id | The Id of the created supply |
row | The row coordinate to place the supply |
col | The column coordinate to place the supply |
Definition at line 35 of file Supply.java.
|
package |
A second constructor of the Supply constructed from supplyTileId.
id | The Id of the created supply |
tileId | The linear combination of (row, column) |
Definition at line 53 of file Supply.java.
|
package |
A deep copy constructor.
Definition at line 68 of file Supply.java.
|
package |
Definition at line 148 of file Supply.java.
|
package |
Definition at line 151 of file Supply.java.
|
package |
Definition at line 149 of file Supply.java.
|
package |
Definition at line 150 of file Supply.java.
|
package |
Definition at line 94 of file Supply.java.
|
package |
Set the position of the supply from a (row, column) pair.
row | The row coordinate of the tile |
col | The column coordinate of the tile |
Definition at line 104 of file Supply.java.
|
package |
Set the position of the supply from a tileId.
tileId | The tileId position |
Definition at line 123 of file Supply.java.
|
package |
Marks the supply removed.
This usually mean the supply is picked up by a user.
Definition at line 138 of file Supply.java.
|
package |
Definition at line 153 of file Supply.java.
|
package |
Definition at line 164 of file Supply.java.
|
package |
Definition at line 154 of file Supply.java.
|
package |
Definition at line 159 of file Supply.java.
|
package |
Definition at line 81 of file Supply.java.
|
package |
Set the supplyId.
sID | The Id to set |
Definition at line 88 of file Supply.java.
|
private |
The unique identifier of the tile.
This must not be confused with TileID
Definition at line 176 of file Supply.java.
|
private |
The Id of the tile on the board, in witch the supply is located.
Definition at line 179 of file Supply.java.
|
private |
The x coordinate of the tile as if the board lies in the 1st quadrant.
Definition at line 177 of file Supply.java.
|
private |
The y coordinate of the tile as if the board lies in the 1st quadrant.
Definition at line 178 of file Supply.java.