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 20 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 32 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 50 of file Supply.java.
|
package |
A deep copy constructor.
Definition at line 65 of file Supply.java.
|
package |
Definition at line 145 of file Supply.java.
|
package |
Definition at line 148 of file Supply.java.
|
package |
Definition at line 146 of file Supply.java.
|
package |
Definition at line 147 of file Supply.java.
|
package |
Definition at line 91 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 101 of file Supply.java.
|
package |
Set the position of the supply from a tileId.
tileId | The tileId position |
Definition at line 120 of file Supply.java.
|
package |
Marks the supply removed.
This usually mean the supply is picked up by a user.
Definition at line 135 of file Supply.java.
|
package |
Definition at line 150 of file Supply.java.
|
package |
Definition at line 161 of file Supply.java.
|
package |
Definition at line 151 of file Supply.java.
|
package |
Definition at line 156 of file Supply.java.
|
package |
Definition at line 78 of file Supply.java.
|
package |
Set the supplyId.
sID | The Id to set |
Definition at line 85 of file Supply.java.
|
private |
The unique identifier of the tile.
This must not be confused with TileID
Definition at line 173 of file Supply.java.
|
private |
The Id of the tile on the board, in witch the supply is located.
Definition at line 176 of file Supply.java.
|
private |
The x coordinate of the tile as if the board lies in the 1st quadrant.
Definition at line 174 of file Supply.java.
|
private |
The y coordinate of the tile as if the board lies in the 1st quadrant.
Definition at line 175 of file Supply.java.