Class GameData

java.lang.Object
model.logic.host.data.GameData
All Implemented Interfaces:
Serializable

public class GameData extends Object implements Serializable
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    The GameData function is a constructor for the GameData class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addPlayer(int playerId, Player playerData)
    The addPlayer function adds a player to the game.
    The getAllPlayers function returns a map of all the players in the game.
    The getBag function returns the bag of tiles that is associated with a player.
    The getBoard function returns the board object.
    The getDictionaries function returns a string of all the dictionaries that are currently being used by the program.
    getPlayer(int playerId)
    The getPlayer function returns the player object associated with a given playerId.
    void
    removePlayer(int playerId)
    The removePlayer function removes a player from the game.
    void
    The setDictionaries function takes a variable number of arguments and stores them in an ArrayList.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GameData

      public GameData()
      The GameData function is a constructor for the GameData class. It initializes the board, bag, player data and dictionaries.
  • Method Details

    • getBoard

      public Board getBoard()
      The getBoard function returns the board object.
      Returns:
      The board object
    • getBag

      public Tile.Bag getBag()
      The getBag function returns the bag of tiles that is associated with a player.
      Returns:
      The bag of the tile
    • getAllPlayers

      public Map<Integer,Player> getAllPlayers()
      The getAllPlayers function returns a map of all the players in the game.
      Returns:
      A map of all the players in the game
    • getPlayer

      public Player getPlayer(int playerId)
      The getPlayer function returns the player object associated with a given playerId.
      Parameters:
      playerId - playerId Get the player from the hashmap
      Returns:
      A player object
    • addPlayer

      public void addPlayer(int playerId, Player playerData)
      The addPlayer function adds a player to the game.
      Parameters:
      playerId - playerId Identify the player
      playerData - playerData Add a player to the game
    • getDictionaries

      public String getDictionaries()
      The getDictionaries function returns a string of all the dictionaries that are currently being used by the program.
      Returns:
      A string of all the dictionaries in the list
    • setDictionaries

      public void setDictionaries(String... args)
      The setDictionaries function takes a variable number of arguments and stores them in an ArrayList.
      Parameters:
      args - args Pass in an array of strings
    • removePlayer

      public void removePlayer(int playerId)
      The removePlayer function removes a player from the game.
      Parameters:
      playerId - playerId Identify the player that is being removed from the game