Interface: QuestInterface
Defined in: src/interface/quest/QuestInterface.ts:5
Extends
QuestBaseInternalInterface
Properties
completed
> readonly completed: boolean
Defined in: src/interface/quest/QuestInterface.ts:40
If the quest is completed.
Inherited from
QuestBaseInternalInterface.completed
currentStage?
> readonly optional currentStage?: StageInterface
Defined in: src/interface/quest/QuestInterface.ts:25
The current stage.
Inherited from
QuestBaseInternalInterface.currentStage
currentStageIndex?
> optional currentStageIndex?: number
Defined in: src/interface/quest/QuestInterface.ts:20
The index of the current stage.
Inherited from
QuestBaseInternalInterface.currentStageIndex
currentStageMustStart
> readonly currentStageMustStart: boolean
Defined in: src/interface/quest/QuestInterface.ts:95
If the current stage must start. It is true if the current stage is not started, can start and not completed.
Inherited from
QuestBaseInternalInterface.currentStageMustStart
failed
> readonly failed: boolean
Defined in: src/interface/quest/QuestInterface.ts:45
If the quest is failed.
Inherited from
QuestBaseInternalInterface.failed
id
> readonly id: string
Defined in: src/interface/quest/QuestInterface.ts:11
The id of the quest.
Inherited from
QuestBaseInternalInterface.id
inProgress
> readonly inProgress: boolean
Defined in: src/interface/quest/QuestInterface.ts:35
If the quest is started and not completed and not failed.
Inherited from
QuestBaseInternalInterface.inProgress
onContinue?
> readonly optional onContinue?: OnRunEvent<QuestInterface>
Defined in: src/interface/quest/QuestInterface.ts:59
The function that will be called when the quest goes to the next stage.
Inherited from
QuestBaseInternalInterface.onContinue
onNextStage?
> readonly optional onNextStage?: OnRunEvent<QuestInterface>
Defined in: src/interface/quest/QuestInterface.ts:55
Deprecated
Use onContinue instead. The function that will be called when the quest goes to the next stage.
Inherited from
QuestBaseInternalInterface.onNextStage
onStart?
> readonly optional onStart?: OnRunEvent<QuestInterface>
Defined in: src/interface/quest/QuestInterface.ts:50
The function that will be called when the quest starts.
Inherited from
QuestBaseInternalInterface.onStart
stages
> readonly stages: StageInterface[]
Defined in: src/interface/quest/QuestInterface.ts:15
The stages of the quest.
Inherited from
QuestBaseInternalInterface.stages
started
> readonly started: boolean
Defined in: src/interface/quest/QuestInterface.ts:30
If the quest is started.
Inherited from
QuestBaseInternalInterface.started
Methods
advanceIfCompleted()
> advanceIfCompleted(props): Promise<boolean>
Defined in: src/interface/quest/QuestInterface.ts:74
Go to the next stage if the current stage is completed. If you want to force the change of stage, use advanceUnconditionally.
Parameters
props
The properties. If you not want to pass any property, you can pass an {}.
Returns
Promise<boolean>
true if the stage was changed, false otherwise.
Inherited from
QuestBaseInternalInterface.advanceIfCompleted
advanceUnconditionally()
> advanceUnconditionally(props): Promise<boolean>
Defined in: src/interface/quest/QuestInterface.ts:90
Ignore the completed state of the current stage and go to the next stage without checking if the current stage is completed. If you want to go to the next stage only if the current stage is completed, use advanceIfCompleted.
Parameters
props
The properties. If you not want to pass any property, you can pass an {}.
Returns
Promise<boolean>
returns true if the stage was changed, false otherwise.
Inherited from
QuestBaseInternalInterface.advanceUnconditionally
continue()
> continue(props): Promise<boolean>
Defined in: src/interface/quest/QuestInterface.ts:82
Complete the current stage and go to the next stage with advanceUnconditionally. If you want to go to the next stage only if the current stage is completed, use advanceIfCompleted.
Parameters
props
The properties. If you not want to pass any property, you can pass an {}.
Returns
Promise<boolean>
true if the stage was changed, false otherwise.
Inherited from
QuestBaseInternalInterface.continue
start()
> start(props): Promise<void>
Defined in: src/interface/quest/QuestInterface.ts:66
Start the quest.
Parameters
props
The properties for the start stage. If you not want to pass any property, you can pass an {}.
Returns
Promise<void>
Inherited from
QuestBaseInternalInterface.start
startCurrentStage()
> startCurrentStage(props): Promise<void>
Defined in: src/interface/quest/QuestInterface.ts:101
Start the current stage. This is a system function, do not use it directly.
Parameters
props
The properties for the start stage. If you not want to pass any property, you can pass an {}.
Returns
Promise<void>
Inherited from
QuestBaseInternalInterface.startCurrentStage