Module polimi.ingsw.am21.codex
Class LocalGameBoard
java.lang.Object
polimi.ingsw.am21.codex.client.localModel.LocalGameBoard
Class that represents the local game board
It is included in the local model container class
It is used to store the information about the current game the player is in for view drawing purposes only.
It includes the current status of the current game the player's in, such as
- the common game board
- the players information including their personal board
- information about the game status, such as the current player index
- the chat
- the remaining rounds
- the index of player associated with the client
- the secret objective of the player associated with the client
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLocalGameBoard
(String gameId, Integer maxPlayers) Constructor for the LocalGameBoard class -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
getChat()
Gets the player that is currently playing their turn.Gets the player that is supposed to play next (assuming the game is not ending)Gets the local player associated with the clientgetPlayerByNickname
(String nickname) Gets the nickname of the local player associated with the clientint
isHalted()
void
setCurrentPlayerIndex
(Integer currentPlayerIndex) void
setGoldCards
(CardPair<Card> goldCards) void
setGoldDeckTopCard
(PlayableCard goldDeckTopCard) void
setObjectiveCards
(CardPair<Card> objectiveCards) void
setPlayerIndex
(int playerIndex) Sets the index of the local player associated with the client, referring to the list of players in the gamevoid
setRemainingRounds
(Integer remainingRounds) void
setResourceCards
(CardPair<Card> resourceCards) void
setResourceDeckTopCard
(PlayableCard resourceDeckTopCard) void
setSecretObjective
(Card secretObjective)
-
Constructor Details
-
LocalGameBoard
Constructor for the LocalGameBoard class- Parameters:
gameId
- The unique identifier of the gamemaxPlayers
- The maximum number of players in the game
-
-
Method Details
-
getCurrentPlayer
Gets the player that is currently playing their turn. -
setCurrentPlayerIndex
-
getPlayerByNickname
-
getGameId
-
getPlayer
Gets the local player associated with the client -
getPlayerNickname
Gets the nickname of the local player associated with the client- Returns:
-
setPlayerIndex
public void setPlayerIndex(int playerIndex) Sets the index of the local player associated with the client, referring to the list of players in the game -
getSecretObjective
-
setSecretObjective
-
getResourceCards
-
setResourceCards
-
getObjectiveCards
-
setObjectiveCards
-
getGoldCards
-
setGoldCards
-
getPlayers
-
setRemainingRounds
-
getRemainingRounds
public int getRemainingRounds() -
getChat
-
getNextPlayer
Gets the player that is supposed to play next (assuming the game is not ending) -
getResourceDeckTopCard
-
setResourceDeckTopCard
-
getGoldDeckTopCard
-
setGoldDeckTopCard
-
gameHalted
public void gameHalted() -
gameResumed
public void gameResumed() -
isHalted
-