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



Defined in: [src/classes/activity/CommitmentStoredClass.ts:41](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/CommitmentStoredClass.ts#L41)

## Extends [#extends]

* [`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass)\<[`CommitmentInterface`](/jsdoc/nqtr/index/interfaces/CommitmentInterface)>

## Extended by [#extended-by]

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

## Implements [#implements]

* `CommitmentBaseInternalInterface`

## Constructors [#constructors]

### Constructor [#constructor]

\> **new CommitmentStoredClass**(`id`, `characters`, `onRun`, `props`): `CommitmentStoredClass`

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

#### Parameters [#parameters]

##### id [#id]

`string`

##### characters [#characters]

(`string` | `CharacterInterface`)\[]

##### onRun [#onrun]

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

##### props [#props]

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

#### Returns [#returns]

`CommitmentStoredClass`

#### Overrides [#overrides]

[`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass).[`constructor`](/jsdoc/nqtr/index/classes/ActivityStoredClass#constructor)

## Properties [#properties]

### \_onRun [#_onrun]

\> `protected` `readonly&#x60; **\_onRun**: [`OnRunEvent`](/jsdoc/nqtr/index/type-aliases/OnRunEvent)\<[`CommitmentInterface`](/jsdoc/nqtr/index/interfaces/CommitmentInterface)>

Defined in: [src/classes/activity/ActivityStoredClass.ts:19](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/ActivityStoredClass.ts#L19)

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

[`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass).[`_onRun`](/jsdoc/nqtr/index/classes/ActivityStoredClass#_onrun)

***

### characters [#characters-1]

\> `readonly` **characters**: `CharacterInterface`\[]

Defined in: [src/classes/activity/CommitmentStoredClass.ts:72](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/CommitmentStoredClass.ts#L72)

The character or characters that are in the commitment and so in the room.

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

`CommitmentBaseInternalInterface.characters`

***

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

`CommitmentBaseInternalInterface.id`

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

[`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass).[`id`](/jsdoc/nqtr/index/classes/ActivityStoredClass#id)

***

### runOptions? [#runoptions]

\> `optional` &#x2A;*runOptions?**: `CommitmentRunOptions`

Defined in: [src/classes/activity/CommitmentStoredClass.ts:111](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/CommitmentStoredClass.ts#L111)

Options for [run](#run).

## Accessors [#accessors]

### dateScheduling [#datescheduling]

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

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

Defined in: [src/classes/activity/ActivityStoredClass.ts:34](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/ActivityStoredClass.ts#L34)

Used to schedule what date it will be added and removed.

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

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

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

`CommitmentBaseInternalInterface.dateScheduling`

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

[`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass).[`dateScheduling`](/jsdoc/nqtr/index/classes/ActivityStoredClass#datescheduling)

***

### executionType [#executiontype]

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

\> **get** **executionType**(): [`ExecutionType`](/jsdoc/nqtr/index/type-aliases/ExecutionType)

Defined in: [src/classes/activity/CommitmentStoredClass.ts:74](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/CommitmentStoredClass.ts#L74)

Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time.

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

[`ExecutionType`](/jsdoc/nqtr/index/type-aliases/ExecutionType)

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

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

Defined in: [src/classes/activity/CommitmentStoredClass.ts:77](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/CommitmentStoredClass.ts#L77)

Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time.

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

###### value [#value]

[`ExecutionType`](/jsdoc/nqtr/index/type-aliases/ExecutionType)

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

`void`

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

`CommitmentBaseInternalInterface.executionType`

***

### expired [#expired]

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

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

Defined in: [src/classes/activity/ActivityStoredClass.ts:48](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/ActivityStoredClass.ts#L48)

Whether the activity/commitment is a deadline, so it will then be removed or hidden.

It **depends only on the date**, not the time. So if you set \{ dateScheduling: \{ from: 0, to: 3 }, timeSlot \{ from: 10, to: 20 } } the activity/commitment hidden or deleted on date 3 at 0.

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

`boolean`

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

`CommitmentBaseInternalInterface.expired`

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

[`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass).[`expired`](/jsdoc/nqtr/index/classes/ActivityStoredClass#expired)

***

### priority [#priority]

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

\> **get** **priority**(): `number`

Defined in: [src/classes/activity/CommitmentStoredClass.ts:81](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/CommitmentStoredClass.ts#L81)

The priority. The higher the number, the higher the priority.
To ensure that a character is not in 2 places at the same time, if there are 2 or more valid commits at the same time and with the same character, the one with the highest priority will be chosen.

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

`number`

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

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

Defined in: [src/classes/activity/CommitmentStoredClass.ts:84](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/CommitmentStoredClass.ts#L84)

The priority. The higher the number, the higher the priority.
To ensure that a character is not in 2 places at the same time, if there are 2 or more valid commits at the same time and with the same character, the one with the highest priority will be chosen.

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

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

`number`

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

`void`

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

`CommitmentBaseInternalInterface.priority`

***

### run [#run]

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

\> **get** **run**(): (`props`, `options?`) => `Promise`\<`any`>

Defined in: [src/classes/activity/CommitmentStoredClass.ts:120](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/CommitmentStoredClass.ts#L120)

Executes the commitment's `onRun` callback.

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

(`props`, `options?`) => `Promise`\<`any`>

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

`CommitmentBaseInternalInterface.run`

#### Overrides [#overrides-1]

[`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass).[`run`](/jsdoc/nqtr/index/classes/ActivityStoredClass#run)

***

### timeSlot [#timeslot]

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

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

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

Time slot in which activity/commitment will be active.

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

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

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

`CommitmentBaseInternalInterface.timeSlot`

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

[`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass).[`timeSlot`](/jsdoc/nqtr/index/classes/ActivityStoredClass#timeslot)

## Methods [#methods]

### addTempHistoryItem() [#addtemphistoryitem]

\> `protected` **addTempHistoryItem**(): `void`

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

#### Returns [#returns-9]

`void`

#### Overrides [#overrides-2]

[`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass).[`addTempHistoryItem`](/jsdoc/nqtr/index/classes/ActivityStoredClass#addtemphistoryitem)

***

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

##### propertyName [#propertyname]

`string`

The name of the property to get.

##### idToUse? [#idtouse]

`string`

The id of the instance to get the property.

#### Returns [#returns-10]

`T` | `undefined`

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

#### Default [#default]

```ts
this.id
```

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

[`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass).[`getStorageProperty`](/jsdoc/nqtr/index/classes/ActivityStoredClass#getstorageproperty)

***

### isActive() [#isactive]

\> **isActive**(`options?`): `boolean`

Defined in: [src/classes/activity/ActivityStoredClass.ts:55](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/activity/ActivityStoredClass.ts#L55)

Whether the activity/commitment is active, so it will be shown in the routine and can be runned.

#### Parameters [#parameters-4]

##### options? [#options]

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

The options to check if the activity/commitment is active.

#### Returns [#returns-11]

`boolean`

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

`CommitmentBaseInternalInterface.isActive`

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

[`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass).[`isActive`](/jsdoc/nqtr/index/classes/ActivityStoredClass#isactive)

***

### migrateOldStorage() [#migrateoldstorage]

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

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

#### Parameters [#parameters-5]

##### oldCategoryId? [#oldcategoryid]

`string`

#### Returns [#returns-12]

`void`

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

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

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

`void`

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

[`ActivityStoredClass`](/jsdoc/nqtr/index/classes/ActivityStoredClass).[`setStorageProperty`](/jsdoc/nqtr/index/classes/ActivityStoredClass#setstorageproperty)
