Package com.csse3200.game.gamestate
Class GameState
java.lang.Object
com.csse3200.game.gamestate.GameState
A data struct that contains other data structs to be saved to JSONs by SaveHandler.
Fields MUST be static.
Not to be kept between playthroughs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic InventorySave
static MinigameHighscore
static PlayerSave
static QuestSave
static StatSave
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Checks whether GameState correctly loaded.static void
Clears all the GameState contents and resets them to their empty state.static void
Clears the contents of the GameState and replaces them with the default saves.
-
Field Details
-
quests
-
inventory
-
player
-
stats
-
minigame
-
-
Method Details
-
resetState
public static void resetState()Clears the contents of the GameState and replaces them with the default saves. -
checkState
public static boolean checkState()Checks whether GameState correctly loaded.- Returns:
- a boolean to indicate whether GameState was correctly loaded. Returns true if the load failed, and false otherwise.
-
clearState
public static void clearState()Clears all the GameState contents and resets them to their empty state.
-