# Class: QuestStoredClass (/jsdoc/nqtr/index/classes/QuestStoredClass)



Defined in: [src/classes/quest/QuestStoredClass.ts:25](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L25)

## Extends [#extends]

* `StoredClassModel`

## Extended by [#extended-by]

* [`QuestBaseModel`](/jsdoc/nqtr/index/classes/QuestBaseModel)

## Implements [#implements]

* `QuestBaseInternalInterface`

## Constructors [#constructors]

### Constructor [#constructor]

\> **new QuestStoredClass**(`id`, `_stages`, `props?`): `QuestStoredClass`

Defined in: [src/classes/quest/QuestStoredClass.ts:29](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L29)

#### Parameters [#parameters]

##### id [#id]

`string`

##### \_stages [#_stages]

[`StageInterface`](/jsdoc/nqtr/index/interfaces/StageInterface)\[]

##### props? [#props]

[`QuestStoredClassProps`](/jsdoc/nqtr/index/interfaces/QuestStoredClassProps) = `{}`

#### Returns [#returns]

`QuestStoredClass`

#### Overrides [#overrides]

`StoredClassModel.constructor`

## Properties [#properties]

### id [#id-1]

\> `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 [#implementation-of]

`QuestBaseInternalInterface.id`

#### Inherited from [#inherited-from]

`StoredClassModel.id`

## Accessors [#accessors]

### completed [#completed]

#### Get Signature [#get-signature]

\> **get** **completed**(): `boolean`

Defined in: [src/classes/quest/QuestStoredClass.ts:62](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L62)

If the quest is completed.

##### Returns [#returns-1]

`boolean`

#### Implementation of [#implementation-of-1]

`QuestBaseInternalInterface.completed`

***

### currentStage [#currentstage]

#### Get Signature [#get-signature-1]

\> **get** **currentStage**(): [`StageInterface`](/jsdoc/nqtr/index/interfaces/StageInterface) | `undefined`

Defined in: [src/classes/quest/QuestStoredClass.ts:50](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L50)

The current stage.

##### Returns [#returns-2]

[`StageInterface`](/jsdoc/nqtr/index/interfaces/StageInterface) | `undefined`

#### Implementation of [#implementation-of-2]

`QuestBaseInternalInterface.currentStage`

***

### currentStageIndex [#currentstageindex]

#### Get Signature [#get-signature-2]

\> **get** **currentStageIndex**(): `number` | `undefined`

Defined in: [src/classes/quest/QuestStoredClass.ts:43](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L43)

The index of the current stage.

##### Returns [#returns-3]

`number` | `undefined`

#### Set Signature [#set-signature]

\> **set** **currentStageIndex**(`value`): `void`

Defined in: [src/classes/quest/QuestStoredClass.ts:46](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L46)

The index of the current stage.

##### Parameters [#parameters-1]

###### value [#value]

`number` | `undefined`

##### Returns [#returns-4]

`void`

#### Implementation of [#implementation-of-3]

`QuestBaseInternalInterface.currentStageIndex`

***

### currentStageMustStart [#currentstagemuststart]

#### Get Signature [#get-signature-3]

\> **get** **currentStageMustStart**(): `boolean`

Defined in: [src/classes/quest/QuestStoredClass.ts:188](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L188)

If the current stage must start. It is true if the current stage is not started, can start and not completed.

##### Returns [#returns-5]

`boolean`

#### Implementation of [#implementation-of-4]

`QuestBaseInternalInterface.currentStageMustStart`

***

### failed [#failed]

#### Get Signature [#get-signature-4]

\> **get** **failed**(): `boolean`

Defined in: [src/classes/quest/QuestStoredClass.ts:79](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L79)

If the quest is failed.

##### Returns [#returns-6]

`boolean`

#### Set Signature [#set-signature-1]

\> **set** **failed**(`value`): `void`

Defined in: [src/classes/quest/QuestStoredClass.ts:82](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L82)

If the quest is failed.

##### Parameters [#parameters-2]

###### value [#value-1]

`boolean`

##### Returns [#returns-7]

`void`

#### Implementation of [#implementation-of-5]

`QuestBaseInternalInterface.failed`

***

### inProgress [#inprogress]

#### Get Signature [#get-signature-5]

\> **get** **inProgress**(): `boolean`

Defined in: [src/classes/quest/QuestStoredClass.ts:69](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L69)

If the quest is started and not completed and not failed.

##### Returns [#returns-8]

`boolean`

#### Implementation of [#implementation-of-6]

`QuestBaseInternalInterface.inProgress`

***

### onContinue [#oncontinue]

#### Get Signature [#get-signature-6]

\> **get** **onContinue**(): [`OnRunEvent`](/jsdoc/nqtr/index/type-aliases/OnRunEvent)\<[`QuestInterface`](/jsdoc/nqtr/index/interfaces/QuestInterface)> | `undefined`

Defined in: [src/classes/quest/QuestStoredClass.ts:92](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L92)

The function that will be called when the quest goes to the next stage.

##### Returns [#returns-9]

[`OnRunEvent`](/jsdoc/nqtr/index/type-aliases/OnRunEvent)\<[`QuestInterface`](/jsdoc/nqtr/index/interfaces/QuestInterface)> | `undefined`

#### Implementation of [#implementation-of-7]

`QuestBaseInternalInterface.onContinue`

***

### onNextStage [#onnextstage]

#### Get Signature [#get-signature-7]

\> **get** **onNextStage**(): [`OnRunEvent`](/jsdoc/nqtr/index/type-aliases/OnRunEvent)\<[`QuestInterface`](/jsdoc/nqtr/index/interfaces/QuestInterface)> | `undefined`

Defined in: [src/classes/quest/QuestStoredClass.ts:95](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L95)

##### Deprecated [#deprecated]

Use [onContinue](/jsdoc/nqtr/index/interfaces/QuestInterface#oncontinue) instead. The function that will be called when the quest goes to the next stage.

##### Returns [#returns-10]

[`OnRunEvent`](/jsdoc/nqtr/index/type-aliases/OnRunEvent)\<[`QuestInterface`](/jsdoc/nqtr/index/interfaces/QuestInterface)> | `undefined`

#### Implementation of [#implementation-of-8]

`QuestBaseInternalInterface.onNextStage`

***

### onStart [#onstart]

#### Get Signature [#get-signature-8]

\> **get** **onStart**(): [`OnRunEvent`](/jsdoc/nqtr/index/type-aliases/OnRunEvent)\<[`QuestInterface`](/jsdoc/nqtr/index/interfaces/QuestInterface)> | `undefined`

Defined in: [src/classes/quest/QuestStoredClass.ts:87](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L87)

The function that will be called when the quest starts.

##### Returns [#returns-11]

[`OnRunEvent`](/jsdoc/nqtr/index/type-aliases/OnRunEvent)\<[`QuestInterface`](/jsdoc/nqtr/index/interfaces/QuestInterface)> | `undefined`

#### Implementation of [#implementation-of-9]

`QuestBaseInternalInterface.onStart`

***

### stages [#stages]

#### Get Signature [#get-signature-9]

\> **get** **stages**(): [`StageInterface`](/jsdoc/nqtr/index/interfaces/StageInterface)\[]

Defined in: [src/classes/quest/QuestStoredClass.ts:39](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L39)

The stages of the quest.

##### Returns [#returns-12]

[`StageInterface`](/jsdoc/nqtr/index/interfaces/StageInterface)\[]

#### Implementation of [#implementation-of-10]

`QuestBaseInternalInterface.stages`

***

### started [#started]

#### Get Signature [#get-signature-10]

\> **get** **started**(): `boolean`

Defined in: [src/classes/quest/QuestStoredClass.ts:58](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L58)

If the quest is started.

##### Returns [#returns-13]

`boolean`

#### Implementation of [#implementation-of-11]

`QuestBaseInternalInterface.started`

## Methods [#methods]

### advanceIfCompleted() [#advanceifcompleted]

\> **advanceIfCompleted**(`props`): `Promise`\<`boolean`>

Defined in: [src/classes/quest/QuestStoredClass.ts:124](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L124)

Go to the next stage if the current stage is completed.
If you want to force the change of stage, use [advanceUnconditionally](/jsdoc/nqtr/index/interfaces/QuestInterface#advanceunconditionally).

#### Parameters [#parameters-3]

##### props [#props-1]

[`OnRunProps`](/jsdoc/nqtr/index/interfaces/OnRunProps)

The properties. If you not want to pass any property, you can pass an \{}.

#### Returns [#returns-14]

`Promise`\<`boolean`>

true if the stage was changed, false otherwise.

#### Implementation of [#implementation-of-12]

`QuestBaseInternalInterface.advanceIfCompleted`

***

### advanceUnconditionally() [#advanceunconditionally]

\> **advanceUnconditionally**(`props`): `Promise`\<`boolean`>

Defined in: [src/classes/quest/QuestStoredClass.ts:161](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L161)

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](/jsdoc/nqtr/index/interfaces/QuestInterface#advanceifcompleted).

#### Parameters [#parameters-4]

##### props [#props-2]

[`OnRunProps`](/jsdoc/nqtr/index/interfaces/OnRunProps)

The properties. If you not want to pass any property, you can pass an \{}.

#### Returns [#returns-15]

`Promise`\<`boolean`>

returns true if the stage was changed, false otherwise.

#### Implementation of [#implementation-of-13]

`QuestBaseInternalInterface.advanceUnconditionally`

***

### continue() [#continue]

\> **continue**(`props`): `Promise`\<`boolean`>

Defined in: [src/classes/quest/QuestStoredClass.ts:145](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L145)

Complete the current stage and go to the next stage with [advanceUnconditionally](/jsdoc/nqtr/index/interfaces/QuestInterface#advanceunconditionally).
If you want to go to the next stage only if the current stage is completed, use [advanceIfCompleted](/jsdoc/nqtr/index/interfaces/QuestInterface#advanceifcompleted).

#### Parameters [#parameters-5]

##### props [#props-3]

[`OnRunProps`](/jsdoc/nqtr/index/interfaces/OnRunProps)

The properties. If you not want to pass any property, you can pass an \{}.

#### Returns [#returns-16]

`Promise`\<`boolean`>

true if the stage was changed, false otherwise.

#### Implementation of [#implementation-of-14]

`QuestBaseInternalInterface.continue`

***

### ~~forceGoNext()~~ [#forcegonext]

\> **forceGoNext**(`props`): `Promise`\<`boolean`>

Defined in: [src/classes/quest/QuestStoredClass.ts:158](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L158)

#### Parameters [#parameters-6]

##### props [#props-4]

[`OnRunProps`](/jsdoc/nqtr/index/interfaces/OnRunProps)

#### Returns [#returns-17]

`Promise`\<`boolean`>

#### Deprecated [#deprecated-1]

Use [advanceUnconditionally](#advanceunconditionally) instead.

***

### getStorageProperty() [#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 [#type-parameters]

##### T [#t]

`T` = `StorageElementType`

#### Parameters [#parameters-7]

##### propertyName [#propertyname]

`string`

The name of the property to get.

##### idToUse? [#idtouse]

`string`

The id of the instance to get the property.

#### Returns [#returns-18]

`T` | `undefined`

The value of the property. If the property is not found, returns undefined.

#### Default [#default]

```ts
this.id
```

#### Inherited from [#inherited-from-1]

`StoredClassModel.getStorageProperty`

***

### ~~goNext()~~ [#gonext]

\> **goNext**(`props`): `Promise`\<`boolean`>

Defined in: [src/classes/quest/QuestStoredClass.ts:142](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L142)

#### Parameters [#parameters-8]

##### props [#props-5]

[`OnRunProps`](/jsdoc/nqtr/index/interfaces/OnRunProps)

#### Returns [#returns-19]

`Promise`\<`boolean`>

#### Deprecated [#deprecated-2]

Use [continue](#continue) instead.

***

### ~~goNextIfCompleted()~~ [#gonextifcompleted]

\> **goNextIfCompleted**(`props`): `Promise`\<`boolean`>

Defined in: [src/classes/quest/QuestStoredClass.ts:121](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L121)

#### Parameters [#parameters-9]

##### props [#props-6]

[`OnRunProps`](/jsdoc/nqtr/index/interfaces/OnRunProps)

#### Returns [#returns-20]

`Promise`\<`boolean`>

#### Deprecated [#deprecated-3]

Use [advanceIfCompleted](#advanceifcompleted) instead.

***

### migrateOldStorage() [#migrateoldstorage]

\> `protected` **migrateOldStorage**(`oldCategoryId?`): `void`

Defined in: node\_modules/@drincs/pixi-vn/dist/StoredClassModel-uMifeNzV.d.ts:37

#### Parameters [#parameters-10]

##### oldCategoryId? [#oldcategoryid]

`string`

#### Returns [#returns-21]

`void`

#### Inherited from [#inherited-from-2]

`StoredClassModel.migrateOldStorage`

***

### setStorageProperty() [#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 [#type-parameters-1]

##### T [#t-1]

`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 [#parameters-11]

##### propertyName [#propertyname-1]

`string`

The name of the property to set.

##### value [#value-2]

`StorageElementType`

The value to set. If is undefined, the property will be removed from the storage.

#### Returns [#returns-22]

`void`

#### Inherited from [#inherited-from-3]

`StoredClassModel.setStorageProperty`

***

### start() [#start]

\> **start**(`props`): `Promise`\<`void`>

Defined in: [src/classes/quest/QuestStoredClass.ts:99](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L99)

Start the quest.

#### Parameters [#parameters-12]

##### props [#props-7]

[`OnRunProps`](/jsdoc/nqtr/index/interfaces/OnRunProps)

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

#### Returns [#returns-23]

`Promise`\<`void`>

#### Implementation of [#implementation-of-15]

`QuestBaseInternalInterface.start`

***

### startCurrentStage() [#startcurrentstage]

\> **startCurrentStage**(`props`): `Promise`\<`void`>

Defined in: [src/classes/quest/QuestStoredClass.ts:196](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestStoredClass.ts#L196)

Start the current stage. This is a system function, do not use it directly.

#### Parameters [#parameters-13]

##### props [#props-8]

[`OnRunProps`](/jsdoc/nqtr/index/interfaces/OnRunProps)

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

#### Returns [#returns-24]

`Promise`\<`void`>

#### Implementation of [#implementation-of-16]

`QuestBaseInternalInterface.startCurrentStage`
