LogoPixi’VN
indexClasses

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

StageInterface[]

props

QuestProps

Returns

QuestBaseModel

Overrides

QuestStoredClass.constructor

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

QuestStoredClass.id

Accessors

completed

Get Signature

> get completed(): boolean

Defined in: src/classes/quest/QuestStoredClass.ts:62

If the quest is completed.

Returns

boolean

Inherited from

QuestStoredClass.completed


currentStage

Get Signature

> get currentStage(): StageInterface | undefined

Defined in: src/classes/quest/QuestStoredClass.ts:50

The current stage.

Returns

StageInterface | undefined

Inherited from

QuestStoredClass.currentStage


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

QuestStoredClass.failed


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

QuestStoredClass.inProgress


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

QuestStoredClass.onContinue


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

QuestStoredClass.onNextStage


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

QuestStoredClass.onStart


stages

Get Signature

> get stages(): StageInterface[]

Defined in: src/classes/quest/QuestStoredClass.ts:39

The stages of the quest.

Returns

StageInterface[]

Inherited from

QuestStoredClass.stages


started

Get Signature

> get started(): boolean

Defined in: src/classes/quest/QuestStoredClass.ts:58

If the quest is started.

Returns

boolean

Inherited from

QuestStoredClass.started

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

OnRunProps

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

OnRunProps

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

OnRunProps

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.continue


forceGoNext()

> forceGoNext(props): Promise<boolean>

Defined in: src/classes/quest/QuestStoredClass.ts:158

Parameters

props

OnRunProps

Returns

Promise<boolean>

Deprecated

Use advanceUnconditionally instead.

Inherited from

QuestStoredClass.forceGoNext


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.id

Inherited from

QuestStoredClass.getStorageProperty


goNext()

> goNext(props): Promise<boolean>

Defined in: src/classes/quest/QuestStoredClass.ts:142

Parameters

props

OnRunProps

Returns

Promise<boolean>

Deprecated

Use continue instead.

Inherited from

QuestStoredClass.goNext


goNextIfCompleted()

> goNextIfCompleted(props): Promise<boolean>

Defined in: src/classes/quest/QuestStoredClass.ts:121

Parameters

props

OnRunProps

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

OnRunProps

The properties for the start stage. If you not want to pass any property, you can pass an {}.

Returns

Promise<void>

Inherited from

QuestStoredClass.start


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

OnRunProps

The properties for the start stage. If you not want to pass any property, you can pass an {}.

Returns

Promise<void>

Inherited from

QuestStoredClass.startCurrentStage

On this page