10 package host.labyrinth;
86 ret[0] = next.
getId();
92 System.out.println(
name +
":\t*Found a supply. [score: " +
score +
"]");
96 System.out.println(
name +
":\t*Can not move.");
128 assert (x >= 0 && x<
Session.
boardSize) :
"X(column) coordinate must be in the range [0, Session.boardSize)";
132 assert (y >= 0 && y<
Session.
boardSize) :
"Y(row) coordinate must be in the range [0, Session.boardSize)";
void setBoard(Board board)
This class is the representation of the games's board.
Class to hold constant values for entire application.
void setChampion(boolean champion)
void setName(String name)
int playerCol()
Utility to access player's column position (column coordinate)
boolean champion
Champion indicate a player who plays against the Minotaur.
int playerTileId()
Utility to access player's tileID.
int x
The column coordinate of the player on the board.
This class represents the game's player.
Board board
Reference to the session's boards.
Player(int id, String name, boolean champion, Board board, int tileId)
Create a new player and put him at the row-column coordinates.
int [] move(int id)
Player's move.
Player(int id, String name, boolean champion, Board board, int row, int column)
Create a new player and put him at the row-column coordinates.
int getId()
Read access to id coordinate.
int getRow()
Read access to virtual row coordinate.
int y
The row coordinate of the player on the board.
int getCol()
Read access to virtual column coordinate.
static int toRow(int id)
Takes Id coordinate and return the corresponding row coordinate.
int score
The current score of the player.
static int toCol(int id)
Takes Id coordinate and return the corresponding column coordinate.
An Application wide board position implementation holding just the id coordinate. ...
int dice()
A plain fair dice functionality provided by the board.
static final int noSupply
Number to indicate the absent of supply.
static int toID(int row, int col)
Takes row and column coordinates and return the calculated Id coordinate.
Application wide object to hold settings like values for the session.
static int boardSize
Default board's size (if no one set it via command line)
boolean isWalkable(int tileId, int direction)
Predicate to check if a direction is Walkable.
String name
The name of the player.
int playerRow()
Utility to access player's row position (row coordinate)
int tryPickSupply(int tileId)
Try to pick supply from a tile.
int playerId
The unique identifier of the player.