Class: QuestBaseModel
Defined in: src/classes/quest/QuestBaseModel.ts:4
Extends
Constructors
Constructor
> new QuestBaseModel(id, stages, props): QuestBaseModel
Defined in: src/classes/quest/QuestBaseModel.ts:5
Parameters
id
string
stages
props
Returns
QuestBaseModel
Overrides
Properties
id
> readonly id: string
Defined in: node_modules/@drincs/pixi-vn/dist/StoredClassModel-uMifeNzV.d.ts:41
Is id of the stored class. is unique for this class.
Inherited from
Accessors
completed
Get Signature
> get completed(): boolean
Defined in: src/classes/quest/QuestStoredClass.ts:62
If the quest is completed.
Returns
boolean
Inherited from
currentStage
Get Signature
> get currentStage(): StageInterface | undefined
Defined in: src/classes/quest/QuestStoredClass.ts:50
The current stage.
Returns
StageInterface | undefined
Inherited from
currentStageIndex
Get Signature
> get currentStageIndex(): number | undefined
Defined in: src/classes/quest/QuestStoredClass.ts:43
The index of the current stage.
Returns
number | undefined
Set Signature
> set currentStageIndex(value): void
Defined in: src/classes/quest/QuestStoredClass.ts:46
The index of the current stage.
Parameters
value
number | undefined
Returns
void
Inherited from
QuestStoredClass.currentStageIndex
currentStageMustStart
Get Signature
> get currentStageMustStart(): boolean
Defined in: src/classes/quest/QuestStoredClass.ts:188
If the current stage must start. It is true if the current stage is not started, can start and not completed.
Returns
boolean
Inherited from
QuestStoredClass.currentStageMustStart
description
Get Signature
> get description(): string
Defined in: src/classes/quest/QuestBaseModel.ts:29
The description of the quest.
Returns
string
failed
Get Signature
> get failed(): boolean
Defined in: src/classes/quest/QuestStoredClass.ts:79
If the quest is failed.
Returns
boolean
Set Signature
> set failed(value): void
Defined in: src/classes/quest/QuestStoredClass.ts:82
If the quest is failed.
Parameters
value
boolean
Returns
void
Inherited from
icon
Get Signature
> get icon(): string | undefined
Defined in: src/classes/quest/QuestBaseModel.ts:37
Icon of the quest.
Returns
string | undefined
image
Get Signature
> get image(): string | undefined
Defined in: src/classes/quest/QuestBaseModel.ts:45
Image of the quest.
Returns
string | undefined
inDevelopment
Get Signature
> get inDevelopment(): boolean
Defined in: src/classes/quest/QuestBaseModel.ts:53
If the quest is in development.
Returns
boolean
inProgress
Get Signature
> get inProgress(): boolean
Defined in: src/classes/quest/QuestStoredClass.ts:69
If the quest is started and not completed and not failed.
Returns
boolean
Inherited from
name
Get Signature
> get name(): string
Defined in: src/classes/quest/QuestBaseModel.ts:21
The name of the quest.
Returns
string
onContinue
Get Signature
> get onContinue(): OnRunEvent<QuestInterface> | undefined
Defined in: src/classes/quest/QuestStoredClass.ts:92
The function that will be called when the quest goes to the next stage.
Returns
OnRunEvent<QuestInterface> | undefined
Inherited from
onNextStage
Get Signature
> get onNextStage(): OnRunEvent<QuestInterface> | undefined
Defined in: src/classes/quest/QuestStoredClass.ts:95
Deprecated
Use onContinue instead. The function that will be called when the quest goes to the next stage.
Returns
OnRunEvent<QuestInterface> | undefined
Inherited from
onStart
Get Signature
> get onStart(): OnRunEvent<QuestInterface> | undefined
Defined in: src/classes/quest/QuestStoredClass.ts:87
The function that will be called when the quest starts.
Returns
OnRunEvent<QuestInterface> | undefined
Inherited from
stages
Get Signature
> get stages(): StageInterface[]
Defined in: src/classes/quest/QuestStoredClass.ts:39
The stages of the quest.
Returns
Inherited from
started
Get Signature
> get started(): boolean
Defined in: src/classes/quest/QuestStoredClass.ts:58
If the quest is started.
Returns
boolean
Inherited from
Methods
advanceIfCompleted()
> advanceIfCompleted(props): Promise<boolean>
Defined in: src/classes/quest/QuestStoredClass.ts:124
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
QuestStoredClass.advanceIfCompleted
advanceUnconditionally()
> advanceUnconditionally(props): Promise<boolean>
Defined in: src/classes/quest/QuestStoredClass.ts:161
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
QuestStoredClass.advanceUnconditionally
continue()
> continue(props): Promise<boolean>
Defined in: src/classes/quest/QuestStoredClass.ts:145
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
forceGoNext()
> forceGoNext(props): Promise<boolean>
Defined in: src/classes/quest/QuestStoredClass.ts:158
Parameters
props
Returns
Promise<boolean>
Deprecated
Use advanceUnconditionally instead.
Inherited from
getStorageProperty()
> protected getStorageProperty<T>(propertyName, idToUse?): T | undefined
Defined in: node_modules/@drincs/pixi-vn/dist/StoredClassModel-uMifeNzV.d.ts:56
Get a property from the storage.
Type Parameters
T
T = StorageElementType
Parameters
propertyName
string
The name of the property to get.
idToUse?
string
The id of the instance to get the property.
Returns
T | undefined
The value of the property. If the property is not found, returns undefined.
Default
this.idInherited from
QuestStoredClass.getStorageProperty
goNext()
> goNext(props): Promise<boolean>
Defined in: src/classes/quest/QuestStoredClass.ts:142
Parameters
props
Returns
Promise<boolean>
Deprecated
Use continue instead.
Inherited from
goNextIfCompleted()
> goNextIfCompleted(props): Promise<boolean>
Defined in: src/classes/quest/QuestStoredClass.ts:121
Parameters
props
Returns
Promise<boolean>
Deprecated
Use advanceIfCompleted instead.
Inherited from
QuestStoredClass.goNextIfCompleted
migrateOldStorage()
> protected migrateOldStorage(oldCategoryId?): void
Defined in: node_modules/@drincs/pixi-vn/dist/StoredClassModel-uMifeNzV.d.ts:37
Parameters
oldCategoryId?
string
Returns
void
Inherited from
QuestStoredClass.migrateOldStorage
setStorageProperty()
> protected setStorageProperty<T>(propertyName, value): void
Defined in: node_modules/@drincs/pixi-vn/dist/StoredClassModel-uMifeNzV.d.ts:49
Update a property in the storage.
Type Parameters
T
T
The type of the value to set. (Deprecated, it is not necessary to specify the type of the value, it will be inferred from the value)
Parameters
propertyName
string
The name of the property to set.
value
StorageElementType
The value to set. If is undefined, the property will be removed from the storage.
Returns
void
Inherited from
QuestStoredClass.setStorageProperty
start()
> start(props): Promise<void>
Defined in: src/classes/quest/QuestStoredClass.ts:99
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
startCurrentStage()
> startCurrentStage(props): Promise<void>
Defined in: src/classes/quest/QuestStoredClass.ts:196
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>