public class GameState
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
GameState(Board board)
Creates a game state.
|
GameState(Board board,
PlayerOrder order)
Creates a game state with a specific player order.
|
Modifier and Type | Method and Description |
---|---|
void |
addPlayer(Player p)
Adds a player to the game.
|
void |
draw(java.awt.Graphics g)
Draw the board.
|
Board |
getBoard() |
Player |
getCurrentPlayer() |
boolean |
getDisplayAllInventory() |
java.util.List<Player> |
getPlayers() |
boolean |
isEndOfGame() |
void |
nextTurn()
Goes to the next turn.
|
void |
setDisplayAllInventory(boolean b)
Sets whether or not every inventory can be seen by any player.
|
void |
setEndOfGame()
Ends the game.
|
void |
setPlayerOrder(PlayerOrder order)
Sets the order in which the player play.
|
public GameState(Board board)
board
- Game board associated to the game.public GameState(Board board, PlayerOrder order)
board
- Game board associated to the game.order
- Order in which players play.public final void addPlayer(Player p)
p
- Player to be added.public final void nextTurn()
public final void draw(java.awt.Graphics g)
g
- Graphics context used for rendering.public final Board getBoard()
public final Player getCurrentPlayer()
public final java.util.List<Player> getPlayers()
public final void setEndOfGame()
public final boolean isEndOfGame()
public final void setDisplayAllInventory(boolean b)
b
- true if all inventories are public. false otherwise.public final boolean getDisplayAllInventory()
public final void setPlayerOrder(PlayerOrder order)
order
- Implementation of the order.