Class QuestManager
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.quests.QuestManager
Manages, tracks and updates the quests within the game.
Handles the storage and retrieval of quests and integrates with the event system.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new quest to the manager.void
completeAchievement
(Achievement achievement) Completes the achievement by changing the state of the achievement and triggering an achievement popupvoid
dispose()
Called when the component is disposed.void
Checks if quest is failed.Returns a list of active or completed quests by iterating through the collection of quests.Gets a list of all quests in QuestManager.Returns a quest by name.void
Automatically loads and registers all of the quests stored in GameState.void
progressQuest
(String questName, String taskName) Progresses the quest based on completion and updates the quest status.Methods inherited from class com.csse3200.game.components.Component
create, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
QuestManager
Constructs questManager instance
-
-
Method Details
-
addQuest
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
Gets a list of all quests in QuestManager.- Returns:
- A list of all quests.
-
getQuest
Returns a quest by name.- Parameters:
questName
- The name of the quest to get.- Returns:
- The quest with the name.
-
failQuest
Checks if quest is failed.- Parameters:
questName
- The name of the quest to fail.
-
progressQuest
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
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
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.
-