Labyrinth
A labyrinth game assignment
|
Go to the documentation of this file.
13 package host.labyrinth;
37 assert (row >= 0 && row<
Session.
boardSize) :
"Row coordinate must be in the range [0, Session.boardSize)";
38 assert (col >= 0 && col<
Session.
boardSize) :
"Column coordinate must be in the range [0, Session.boardSize)";
56 :
"TileId must be in the range of [0, Session.boardSize^2)";
106 assert (row >= 0 && row<
Session.
boardSize) :
"Row coordinate must be in the range [0, Session.boardSize)";
107 assert (col >= 0 && col<
Session.
boardSize) :
"Column coordinate must be in the range [0, Session.boardSize)";
126 :
"TileId must be in the range of [0, Session.boardSize^2)";
155 assert (
x >= 0 &&
x<
Session.
boardSize) :
"X(column) coordinate must be in the range [0, Session.boardSize)";
160 assert (
y >= 0 &&
y<
Session.
boardSize) :
"Y(row) coordinate must be in the range [0, Session.boardSize)";
166 :
"TileId must be in the range of [0, Session.boardSize^2)";
int supplyId(int sID)
Set the supplyId.
static int toCol(int id)
Takes Id coordinate and return the corresponding column coordinate.
Class to hold constant values for entire application.
int x
The x coordinate of the tile as if the board lies in the 1st quadrant.
Position position(int tileId)
Set the position of the supply from a tileId.
Position position(int row, int col)
Set the position of the supply from a (row, column) pair.
int getRow()
Read access to virtual row coordinate.
This class is the representation of the supplies in the game.
Supply(int id, int tileId)
A second constructor of the Supply constructed from supplyTileId.
Application wide object to hold settings like values for the session.
int supplyTileId
The Id of the tile on the board, in witch the supply is located.
void setSupplyTileId(int tileId)
static int boardSize
Default board's size (if no one set it via command line)
static int toRow(int id)
Takes Id coordinate and return the corresponding row coordinate.
void removeSupply()
Marks the supply removed.
An Application wide board position implementation holding just the id coordinate.
int y
The y coordinate of the tile as if the board lies in the 1st quadrant.
int supplyId
The unique identifier of the tile.
int getCol()
Read access to virtual column coordinate.
static final int noSupply
Number to indicate the absent of supply.
int getId()
Read access to id coordinate.
static int toID(int row, int col)
Takes row and column coordinates and return the calculated Id coordinate.
Supply(int id, int row, int col)
The main constructor of the Supply constructed from (row,column)
Supply(Supply s)
A deep copy constructor.