java.lang.Object
polimi.ingsw.am21.codex.client.localModel.LocalGameBoard

public class LocalGameBoard extends Object
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 Details

    • LocalGameBoard

      public LocalGameBoard(String gameId, Integer maxPlayers)
      Constructor for the LocalGameBoard class
      Parameters:
      gameId - The unique identifier of the game
      maxPlayers - The maximum number of players in the game
  • Method Details

    • getCurrentPlayer

      public LocalPlayer getCurrentPlayer()
      Gets the player that is currently playing their turn.
    • setCurrentPlayerIndex

      public void setCurrentPlayerIndex(Integer currentPlayerIndex)
    • getPlayerByNickname

      public Optional<LocalPlayer> getPlayerByNickname(String nickname)
    • getGameId

      public String getGameId()
    • getPlayer

      public LocalPlayer getPlayer()
      Gets the local player associated with the client
    • getPlayerNickname

      public String 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

      public Card getSecretObjective()
    • setSecretObjective

      public void setSecretObjective(Card secretObjective)
    • getResourceCards

      public CardPair<Card> getResourceCards()
    • setResourceCards

      public void setResourceCards(CardPair<Card> resourceCards)
    • getObjectiveCards

      public CardPair<Card> getObjectiveCards()
    • setObjectiveCards

      public void setObjectiveCards(CardPair<Card> objectiveCards)
    • getGoldCards

      public CardPair<Card> getGoldCards()
    • setGoldCards

      public void setGoldCards(CardPair<Card> goldCards)
    • getPlayers

      public List<LocalPlayer> getPlayers()
    • setRemainingRounds

      public void setRemainingRounds(Integer remainingRounds)
    • getRemainingRounds

      public int getRemainingRounds()
    • getChat

      public Chat getChat()
    • getNextPlayer

      public LocalPlayer getNextPlayer()
      Gets the player that is supposed to play next (assuming the game is not ending)
    • getResourceDeckTopCard

      public PlayableCard getResourceDeckTopCard()
    • setResourceDeckTopCard

      public void setResourceDeckTopCard(PlayableCard resourceDeckTopCard)
    • getGoldDeckTopCard

      public PlayableCard getGoldDeckTopCard()
    • setGoldDeckTopCard

      public void setGoldDeckTopCard(PlayableCard goldDeckTopCard)
    • gameHalted

      public void gameHalted()
    • gameResumed

      public void gameResumed()
    • isHalted

      public Boolean isHalted()