|
|
@@ -10,7 +10,7 @@ package net.hoo2.auth.dsproject.snake; |
|
|
|
* * All member functions
|
|
|
|
* * All data members
|
|
|
|
*
|
|
|
|
* @author Christos Choutouridis 8997
|
|
|
|
* @author Christos Choutouridis AEM:8997
|
|
|
|
* @email cchoutou@ece.auth.gr
|
|
|
|
*/
|
|
|
|
|
|
|
@@ -25,24 +25,24 @@ import java.util.ArrayList; |
|
|
|
* This class includes the main function.Using this class's api
|
|
|
|
* the user can create a board, register players and roll the game.
|
|
|
|
*
|
|
|
|
* @author Christos Choutouridis 8997
|
|
|
|
* @author Christos Choutouridis AEM:8997
|
|
|
|
* @email cchoutou@ece.auth.gr
|
|
|
|
*/
|
|
|
|
public class Game {
|
|
|
|
/** Constants */
|
|
|
|
/** @name Constants */
|
|
|
|
/**@{ */
|
|
|
|
static final int MAX_PLAYERS = 4; /**< The maximum number of allowed players in the game */
|
|
|
|
static final int MAX_GAME_ROUNDS = 10000; /**< the maximum allowed round of the game */
|
|
|
|
/**@} */
|
|
|
|
|
|
|
|
/** Private data members */
|
|
|
|
/** @name Private data members */
|
|
|
|
/** @{ */
|
|
|
|
private int round; /**< The current round of the game */
|
|
|
|
private Board board; /**< A reference to board */
|
|
|
|
private ArrayList<Player> players; /**< A reference to players */
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** private api */
|
|
|
|
/** @name private api */
|
|
|
|
/** @{ */
|
|
|
|
/**
|
|
|
|
* Dice functionality
|
|
|
@@ -68,7 +68,7 @@ public class Game { |
|
|
|
/** @} */
|
|
|
|
|
|
|
|
|
|
|
|
/** Constructors */
|
|
|
|
/** @name Constructors */
|
|
|
|
/** @{ */
|
|
|
|
/** Default doing nothing constructor */
|
|
|
|
Game () {
|
|
|
@@ -95,7 +95,7 @@ public class Game { |
|
|
|
}
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** Get/Set interface */
|
|
|
|
/** @name Get/Set interface */
|
|
|
|
/** @{ */
|
|
|
|
int getRound () { return round; }
|
|
|
|
void setRound (int round) { this.round = round; }
|
|
|
@@ -120,7 +120,7 @@ public class Game { |
|
|
|
}
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** Public functionality */
|
|
|
|
/** @name Public functionality */
|
|
|
|
/** @{ */
|
|
|
|
/**
|
|
|
|
* Register a player to the game
|
|
|
|