java.lang.Object
model.logic.host.data.GameData
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe addPlayer function adds a player to the game.The getAllPlayers function returns a map of all the players in the game.getBag()The getBag function returns the bag of tiles that is associated with a player.getBoard()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.voidremovePlayer(int playerId) The removePlayer function removes a player from the game.voidsetDictionaries(String... args) The setDictionaries function takes a variable number of arguments and stores them in an ArrayList.
-
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
The getBoard function returns the board object.- Returns:
- The board object
-
getBag
The getBag function returns the bag of tiles that is associated with a player.- Returns:
- The bag of the tile
-
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
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
The addPlayer function adds a player to the game.- Parameters:
playerId- playerId Identify the playerplayerData- playerData Add a player to the game
-
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
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
-