LogoPixi’VN
indexClasses

Class: QuestStoredClass

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

Extends

  • StoredClassModel

Extended by

Implements

  • QuestBaseInternalInterface

Constructors

Constructor

> new QuestStoredClass(id, _stages, props?): QuestStoredClass

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

Parameters

id

string

_stages

StageInterface[]

props?

QuestStoredClassProps = {}

Returns

QuestStoredClass

Overrides

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

Implementation of

QuestBaseInternalInterface.id

Inherited from

StoredClassModel.id

Accessors

completed

Get Signature

> get completed(): boolean

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

If the quest is completed.

Returns

boolean

Implementation of

QuestBaseInternalInterface.completed


currentStage

Get Signature

> get currentStage(): StageInterface | undefined

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

The current stage.

Returns

StageInterface | undefined

Implementation of

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

Implementation of

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

Implementation of

QuestBaseInternalInterface.currentStageMustStart


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

Implementation of

QuestBaseInternalInterface.failed


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

Implementation of

QuestBaseInternalInterface.inProgress


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

Implementation of

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

Implementation of

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

Implementation of

QuestBaseInternalInterface.onStart


stages

Get Signature

> get stages(): StageInterface[]

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

The stages of the quest.

Returns

StageInterface[]

Implementation of

QuestBaseInternalInterface.stages


started

Get Signature

> get started(): boolean

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

If the quest is started.

Returns

boolean

Implementation of

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

Implementation of

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

Implementation of

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

Implementation of

QuestBaseInternalInterface.continue


forceGoNext()

> forceGoNext(props): Promise<boolean>

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

Parameters

props

OnRunProps

Returns

Promise<boolean>

Deprecated

Use advanceUnconditionally instead.


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

StoredClassModel.getStorageProperty


goNext()

> goNext(props): Promise<boolean>

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

Parameters

props

OnRunProps

Returns

Promise<boolean>

Deprecated

Use continue instead.


goNextIfCompleted()

> goNextIfCompleted(props): Promise<boolean>

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

Parameters

props

OnRunProps

Returns

Promise<boolean>

Deprecated

Use advanceIfCompleted instead.


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

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

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

Implementation of

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

Implementation of

QuestBaseInternalInterface.startCurrentStage

On this page