Class: CommitmentStoredClass
Defined in: src/classes/activity/CommitmentStoredClass.ts:41
Extends
Extended by
Implements
CommitmentBaseInternalInterface
Constructors
Constructor
> new CommitmentStoredClass(id, characters, onRun, props): CommitmentStoredClass
Defined in: src/classes/activity/CommitmentStoredClass.ts:45
Parameters
id
string
characters
(string | CharacterInterface)[]
onRun
OnRunEvent<CommitmentInterface> | undefined
props
Returns
CommitmentStoredClass
Overrides
ActivityStoredClass.constructor
Properties
_onRun
> protected readonly _onRun: OnRunEvent<CommitmentInterface>
Defined in: src/classes/activity/ActivityStoredClass.ts:19
Inherited from
characters
> readonly characters: CharacterInterface[]
Defined in: src/classes/activity/CommitmentStoredClass.ts:72
The character or characters that are in the commitment and so in the room.
Implementation of
CommitmentBaseInternalInterface.characters
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
CommitmentBaseInternalInterface.id
Inherited from
runOptions?
> optional runOptions?: CommitmentRunOptions
Defined in: src/classes/activity/CommitmentStoredClass.ts:111
Options for run.
Accessors
dateScheduling
Get Signature
> get dateScheduling(): DateSchedulingInterface | undefined
Defined in: src/classes/activity/ActivityStoredClass.ts:34
Used to schedule what date it will be added and removed.
Returns
DateSchedulingInterface | undefined
Implementation of
CommitmentBaseInternalInterface.dateScheduling
Inherited from
ActivityStoredClass.dateScheduling
executionType
Get Signature
> get executionType(): ExecutionType
Defined in: src/classes/activity/CommitmentStoredClass.ts:74
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
Set Signature
> set executionType(value): void
Defined in: src/classes/activity/CommitmentStoredClass.ts:77
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
value
Returns
void
Implementation of
CommitmentBaseInternalInterface.executionType
expired
Get Signature
> get expired(): boolean
Defined in: src/classes/activity/ActivityStoredClass.ts:48
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
boolean
Implementation of
CommitmentBaseInternalInterface.expired
Inherited from
priority
Get Signature
> get priority(): number
Defined in: src/classes/activity/CommitmentStoredClass.ts:81
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
number
Set Signature
> set priority(value): void
Defined in: src/classes/activity/CommitmentStoredClass.ts:84
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
value
number
Returns
void
Implementation of
CommitmentBaseInternalInterface.priority
run
Get Signature
> get run(): (props, options?) => Promise<any>
Defined in: src/classes/activity/CommitmentStoredClass.ts:120
Executes the commitment's onRun callback.
Returns
(props, options?) => Promise<any>
Implementation of
CommitmentBaseInternalInterface.run
Overrides
timeSlot
Get Signature
> get timeSlot(): TimeSchedulingInterface | TimeSchedulingInterface[] | undefined
Defined in: src/classes/activity/ActivityStoredClass.ts:29
Time slot in which activity/commitment will be active.
Returns
TimeSchedulingInterface | TimeSchedulingInterface[] | undefined
Implementation of
CommitmentBaseInternalInterface.timeSlot
Inherited from
Methods
addTempHistoryItem()
> protected addTempHistoryItem(): void
Defined in: src/classes/activity/CommitmentStoredClass.ts:87
Returns
void
Overrides
ActivityStoredClass.addTempHistoryItem
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.idInherited from
ActivityStoredClass.getStorageProperty
isActive()
> isActive(options?): boolean
Defined in: src/classes/activity/ActivityStoredClass.ts:55
Whether the activity/commitment is active, so it will be shown in the routine and can be runned.
Parameters
options?
ActiveScheduling = {}
The options to check if the activity/commitment is active.
Returns
boolean
Implementation of
CommitmentBaseInternalInterface.isActive
Inherited from
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
ActivityStoredClass.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