Package de.tum.cit.fop.maze
Class GameInfo
java.lang.Object
de.tum.cit.fop.maze.GameInfo
Holds global game information, including settings and achievement controllers.
It serves as a central access point for persistent game state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the achievement controller.Gets the path of the currently selected level.Gets the game settings.voidInitializes the achievement controller by loading achievements from storage.voidInitializes the game settings by loading them from storage.voidRestores the default achievements, resetting progress.voidRestores default game settings.voidsetSelectedLevel(String selectedLevel) Sets the path for the selected level.
-
Constructor Details
-
GameInfo
public GameInfo()Creates a new GameInfo instance. Settings and achievement controller are initially null and must be initialized.
-
-
Method Details
-
initializeSettings
public void initializeSettings()Initializes the game settings by loading them from storage. -
initializeAchievements
public void initializeAchievements()Initializes the achievement controller by loading achievements from storage. -
getAchievementController
Gets the achievement controller.- Returns:
- The initialized AchievementController.
- Throws:
IllegalStateException- if the controller has not been initialized.
-
restoreDefaultAchievements
public void restoreDefaultAchievements()Restores the default achievements, resetting progress. -
getSettings
Gets the game settings.- Returns:
- The initialized GameSettings.
- Throws:
IllegalStateException- if settings have not been initialized.
-
restoreDefaultSettings
public void restoreDefaultSettings()Restores default game settings. -
getSelectedLevel
Gets the path of the currently selected level.- Returns:
- The file path of the selected level.
-
setSelectedLevel
Sets the path for the selected level.- Parameters:
selectedLevel- The file path of the level to select.
-