Class Task
java.lang.Object
com.csse3200.game.components.quests.Task
Handles the tasks for each quest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
failTask()
Marks the task as failed.Returns the description for tasks.getHint()
Returns the hint for tasks.int
Returns the number of triggers required to complete this task.Returns the task name.int
Returns how many times task is triggered.void
Handles an event related to the task.boolean
Checks if quest is completed.boolean
isFailed()
Checks if task is failed.
-
Constructor Details
-
Task
public Task(String taskName, String description, String hint, int requiredTriggers, int triggerCount, boolean completed, boolean failed) Constructs a new Task with specific details.- Parameters:
taskName
- The name of the task.description
- A description of what the task involves.hint
- A hint related to completing the task.requiredTriggers
- The number of triggers required to complete task.
-
-
Method Details
-
getTaskName
Returns the task name. -
getDescription
Returns the description for tasks. -
getHint
Returns the hint for tasks. -
isCompleted
public boolean isCompleted()Checks if quest is completed. -
getTriggerCount
public int getTriggerCount()Returns how many times task is triggered. -
getRequiredTriggers
public int getRequiredTriggers()Returns the number of triggers required to complete this task. -
isFailed
public boolean isFailed()Checks if task is failed. -
failTask
public void failTask()Marks the task as failed. -
handleEvent
public void handleEvent()Handles an event related to the task.
-