LogoPixi’VN
indexClasses

Class: ActivityBaseModel

Defined in: src/classes/activity/ActivityBaseModel.ts:31

The activity model. It is used to create an activity.

Example

export const nap = new ActivityModel("nap",
    (_, event) => {
        if (event) {
            event.navigate("/game")
            callLabelWithGoNavigationCallBack(napLabel, event)
        }
        else {
            console.error("Event is undefined")
        }
    },
    {
        name: "Nap",
        timeSlot: {
            from: 5,
            to: 23,
        },
        icon: "https://icon.jpg",
    }
)

Extends

Constructors

Constructor

> new ActivityBaseModel(id, onRun, props): ActivityBaseModel

Defined in: src/classes/activity/ActivityBaseModel.ts:37

Parameters

id

string

The activity id, that must be unique.

onRun

OnRunEvent<ActivityInterface>

The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.

props

ActivityProps

The activity properties.

Returns

ActivityBaseModel

Overrides

ActivityStoredClass.constructor

Properties

_onRun

> protected readonly _onRun: OnRunEvent<ActivityInterface>

Defined in: src/classes/activity/ActivityStoredClass.ts:19

Inherited from

ActivityStoredClass._onRun


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.

Inherited from

ActivityStoredClass.id

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

Inherited from

ActivityStoredClass.dateScheduling


disabled

Get Signature

> get disabled(): boolean

Defined in: src/classes/activity/ActivityBaseModel.ts:63

Whether is disabled. If it is a string, it is a Pixi'VN flag name.

Returns

boolean

Set Signature

> set disabled(value): void

Defined in: src/classes/activity/ActivityBaseModel.ts:70

Parameters
value

string | boolean

Returns

void


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

Inherited from

ActivityStoredClass.expired


hidden

Get Signature

> get hidden(): boolean

Defined in: src/classes/activity/ActivityBaseModel.ts:78

Whether is hidden. If it is a string, it is a Pixi'VN flag name.

Returns

boolean

Set Signature

> set hidden(value): void

Defined in: src/classes/activity/ActivityBaseModel.ts:85

Parameters
value

string | boolean

Returns

void


icon

Get Signature

> get icon(): string | undefined

Defined in: src/classes/activity/ActivityBaseModel.ts:93

The icon of the activity.

Returns

string | undefined


name

Get Signature

> get name(): string

Defined in: src/classes/activity/ActivityBaseModel.ts:52

The name of the activity.

Returns

string

Set Signature

> set name(value): void

Defined in: src/classes/activity/ActivityBaseModel.ts:55

Parameters
value

string | undefined

Returns

void


run

Get Signature

> get run(): OnRunAsyncFunction

Defined in: src/classes/activity/ActivityStoredClass.ts:41

The function that is called when the activity/commitment is runned.

Returns

OnRunAsyncFunction

Inherited from

ActivityStoredClass.run


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

Inherited from

ActivityStoredClass.timeSlot

Methods

addTempHistoryItem()

> protected addTempHistoryItem(): void

Defined in: src/classes/activity/ActivityStoredClass.ts:38

Returns

void

Inherited from

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

Inherited 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

Inherited from

ActivityStoredClass.isActive


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

Inherited from

ActivityStoredClass.setStorageProperty

On this page