Class QuestManager

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.quests.QuestManager

public class QuestManager extends Component
Manages, tracks and updates the quests within the game. Handles the storage and retrieval of quests and integrates with the event system.
  • Constructor Details

    • QuestManager

      public QuestManager(Entity player)
      Constructs questManager instance
  • Method Details

    • addQuest

      public void addQuest(Quest quest)
      Adds a new quest to the manager.
      Parameters:
      quest - The quest to be added.
    • loadQuests

      public void loadQuests()
      Automatically loads and registers all of the quests stored in GameState.
      See Also:
    • getAllQuests

      public List<Quest> getAllQuests()
      Gets a list of all quests in QuestManager.
      Returns:
      A list of all quests.
    • getQuest

      public Quest getQuest(String questName)
      Returns a quest by name.
      Parameters:
      questName - The name of the quest to get.
      Returns:
      The quest with the name.
    • failQuest

      public void failQuest(String questName)
      Checks if quest is failed.
      Parameters:
      questName - The name of the quest to fail.
    • progressQuest

      public void progressQuest(String questName, String taskName)
      Progresses the quest based on completion and updates the quest status.
      Parameters:
      questName - The name of the quest.
      taskName - The name of the task.
    • getActiveQuests

      public List<Quest> getActiveQuests()
      Returns a list of active or completed quests by iterating through the collection of quests.
      Returns:
      a list of quest objects representing the quests that are currently active or have been completed.
    • completeAchievement

      public void completeAchievement(Achievement achievement)
      Completes the achievement by changing the state of the achievement and triggering an achievement popup
      Parameters:
      achievement - The achievement being completed
    • dispose

      public void dispose()
      Description copied from class: Component
      Called when the component is disposed. Dispose of any internal resources here.
      Overrides:
      dispose in class Component