Class GameInfo

java.lang.Object
de.tum.cit.fop.maze.GameInfo

public class GameInfo extends Object
Holds global game information, including settings and achievement controllers. It serves as a central access point for persistent game state.
  • 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

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

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

      public String getSelectedLevel()
      Gets the path of the currently selected level.
      Returns:
      The file path of the selected level.
    • setSelectedLevel

      public void setSelectedLevel(String selectedLevel)
      Sets the path for the selected level.
      Parameters:
      selectedLevel - The file path of the level to select.