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



Defined in: [src/classes/quest/QuestBaseModel.ts:4](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestBaseModel.ts#L4)

## Extends [#extends]

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

## Constructors [#constructors]

### Constructor [#constructor]

\> **new QuestBaseModel**(`id`, `stages`, `props`): `QuestBaseModel`

Defined in: [src/classes/quest/QuestBaseModel.ts:5](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestBaseModel.ts#L5)

#### Parameters [#parameters]

##### id [#id]

`string`

##### stages [#stages]

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

##### props [#props]

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

#### Returns [#returns]

`QuestBaseModel`

#### Overrides [#overrides]

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`constructor`](/jsdoc/nqtr/index/classes/QuestStoredClass#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.

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`id`](/jsdoc/nqtr/index/classes/QuestStoredClass#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`

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`completed`](/jsdoc/nqtr/index/classes/QuestStoredClass#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`

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`currentStage`](/jsdoc/nqtr/index/classes/QuestStoredClass#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`

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`currentStageIndex`](/jsdoc/nqtr/index/classes/QuestStoredClass#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`

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`currentStageMustStart`](/jsdoc/nqtr/index/classes/QuestStoredClass#currentstagemuststart)

***

### description [#description]

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

\> **get** **description**(): `string`

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

The description of the quest.

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

`string`

***

### failed [#failed]

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

\> **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-7]

`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-8]

`void`

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`failed`](/jsdoc/nqtr/index/classes/QuestStoredClass#failed)

***

### icon [#icon]

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

\> **get** **icon**(): `string` | `undefined`

Defined in: [src/classes/quest/QuestBaseModel.ts:37](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestBaseModel.ts#L37)

Icon of the quest.

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

`string` | `undefined`

***

### image [#image]

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

\> **get** **image**(): `string` | `undefined`

Defined in: [src/classes/quest/QuestBaseModel.ts:45](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestBaseModel.ts#L45)

Image of the quest.

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

`string` | `undefined`

***

### inDevelopment [#indevelopment]

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

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

Defined in: [src/classes/quest/QuestBaseModel.ts:53](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestBaseModel.ts#L53)

If the quest is in development.

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

`boolean`

***

### inProgress [#inprogress]

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

\> **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-12]

`boolean`

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`inProgress`](/jsdoc/nqtr/index/classes/QuestStoredClass#inprogress)

***

### name [#name]

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

\> **get** **name**(): `string`

Defined in: [src/classes/quest/QuestBaseModel.ts:21](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/quest/QuestBaseModel.ts#L21)

The name of the quest.

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

`string`

***

### onContinue [#oncontinue]

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

\> **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-14]

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

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`onContinue`](/jsdoc/nqtr/index/classes/QuestStoredClass#oncontinue)

***

### onNextStage [#onnextstage]

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

\> **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-15]

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

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`onNextStage`](/jsdoc/nqtr/index/classes/QuestStoredClass#onnextstage)

***

### onStart [#onstart]

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

\> **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-16]

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

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`onStart`](/jsdoc/nqtr/index/classes/QuestStoredClass#onstart)

***

### stages [#stages-1]

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

\> **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-17]

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

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`stages`](/jsdoc/nqtr/index/classes/QuestStoredClass#stages)

***

### started [#started]

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

\> **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-18]

`boolean`

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`started`](/jsdoc/nqtr/index/classes/QuestStoredClass#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-19]

`Promise`\<`boolean`>

true if the stage was changed, false otherwise.

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`advanceIfCompleted`](/jsdoc/nqtr/index/classes/QuestStoredClass#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-20]

`Promise`\<`boolean`>

returns true if the stage was changed, false otherwise.

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`advanceUnconditionally`](/jsdoc/nqtr/index/classes/QuestStoredClass#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-21]

`Promise`\<`boolean`>

true if the stage was changed, false otherwise.

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`continue`](/jsdoc/nqtr/index/classes/QuestStoredClass#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-22]

`Promise`\<`boolean`>

#### Deprecated [#deprecated-1]

Use [advanceUnconditionally](/jsdoc/nqtr/index/classes/QuestStoredClass#advanceunconditionally) instead.

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`forceGoNext`](/jsdoc/nqtr/index/classes/QuestStoredClass#forcegonext)

***

### 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-23]

`T` | `undefined`

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

#### Default [#default]

```ts
this.id
```

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`getStorageProperty`](/jsdoc/nqtr/index/classes/QuestStoredClass#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-24]

`Promise`\<`boolean`>

#### Deprecated [#deprecated-2]

Use [continue](/jsdoc/nqtr/index/classes/QuestStoredClass#continue) instead.

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`goNext`](/jsdoc/nqtr/index/classes/QuestStoredClass#gonext)

***

### ~~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-25]

`Promise`\<`boolean`>

#### Deprecated [#deprecated-3]

Use [advanceIfCompleted](/jsdoc/nqtr/index/classes/QuestStoredClass#advanceifcompleted) instead.

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`goNextIfCompleted`](/jsdoc/nqtr/index/classes/QuestStoredClass#gonextifcompleted)

***

### 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-26]

`void`

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`migrateOldStorage`](/jsdoc/nqtr/index/classes/QuestStoredClass#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-27]

`void`

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`setStorageProperty`](/jsdoc/nqtr/index/classes/QuestStoredClass#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-28]

`Promise`\<`void`>

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`start`](/jsdoc/nqtr/index/classes/QuestStoredClass#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-29]

`Promise`\<`void`>

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

[`QuestStoredClass`](/jsdoc/nqtr/index/classes/QuestStoredClass).[`startCurrentStage`](/jsdoc/nqtr/index/classes/QuestStoredClass#startcurrentstage)
