Class Quest.QuestBuilder
java.lang.Object
com.csse3200.game.components.quests.Quest.QuestBuilder
- Enclosing class:
Quest
A builder class for the quest, wrapping the private constructor.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDialogueKey
(DialogueKey dialogueKey) Adds dialogue to the questaddFollowQuest
(String follow) Adds a prerequisite quest to the questAdds a task to the questaddTrigger
(String trigger) Adds a trigger to the questbuild()
Constructs the final quest instance.setActive
(boolean active) Sets the active state of the questsetDescription
(String description) Sets the description of the questsetFailed
(boolean failed) Sets the failed state of the questsetIndex
(int index) Sets the task index of the quest
-
Constructor Details
-
QuestBuilder
-
-
Method Details
-
build
Constructs the final quest instance.- Returns:
- the constructed quest instance
-
setDescription
Sets the description of the quest- Parameters:
description
- the description of the quest- Returns:
- this QuestBuilder
-
addTask
Adds a task to the quest- Parameters:
task
- the task to be added- Returns:
- this QuestBuilder
-
addDialogueKey
Adds dialogue to the quest- Parameters:
dialogueKey
- the dialogue to be added- Returns:
- this QuestBuilder
-
addTrigger
Adds a trigger to the quest- Parameters:
trigger
- the trigger to be added- Returns:
- this QuestBuilder
-
setActive
Sets the active state of the quest- Parameters:
active
- the new active state- Returns:
- this QuestBuilder
-
setIndex
Sets the task index of the quest- Parameters:
index
- the new task index- Returns:
- this QuestBuilder
-
addFollowQuest
Adds a prerequisite quest to the quest- Parameters:
follow
- the prerequisite quest name to be added- Returns:
- this QuestBuilder
-
setFailed
Sets the failed state of the quest- Parameters:
failed
- the new failed state- Returns:
- this QuestBuilder
-