# Class: RoomBaseModel (/nqtr/index/classes/RoomBaseModel)



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

The base model of a room. I suggest you extend this class to create your own room model.
**You must use the [RegisteredRooms.add](/nqtr/index/namespaces/RegisteredRooms/functions/add) function to save the room in the registered rooms.**

## Example [#example]

```ts
export const mcRoom = new RoomBaseModel('mc_room', mcHome, {
    name: "MC Room",
    icon: "https://icon.jpg",
    image: "https://image.jpg",
})
RegisteredRooms.add(mcRoom)
```

## Extends [#extends]

* [`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass)

## Constructors [#constructors]

### Constructor [#constructor]

\> **new RoomBaseModel**(`id`, `location`, `props?`): `RoomBaseModel`

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

#### Parameters [#parameters]

##### id [#id]

`string`

The id of the room, it must be unique.

##### location [#location]

[`LocationInterface`](/nqtr/index/interfaces/LocationInterface)

The location where the room is.

##### props? [#props]

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

The properties of the room.

#### Returns [#returns]

`RoomBaseModel`

#### Overrides [#overrides]

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

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

## Accessors [#accessors]

### activities [#activities]

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

\> **get** **activities**(): [`ActivityInterface`](/nqtr/index/interfaces/ActivityInterface)\[]

Defined in: [src/classes/navigation/NavigationAbstractClass.ts:176](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/NavigationAbstractClass.ts#L176)

The activities associated with this class, filtered based on their scheduling.

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

[`ActivityInterface`](/nqtr/index/interfaces/ActivityInterface)\[]

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`activities`](/nqtr/index/classes/RoomStoredClass#activities)

***

### activitiesIds [#activitiesids]

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

\> **get** **activitiesIds**(): `string`\[]

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

All the ids of the activities associated with this class. Compared to [activities](/nqtr/index/interfaces/LocationInterface#activities), they are not filtered based on their scheduling.

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

`string`\[]

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`activitiesIds`](/nqtr/index/classes/RoomStoredClass#activitiesids)

***

### automaticFunctions [#automaticfunctions]

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

\> **get** **automaticFunctions**(): [`OnRunAsyncFunction`](/nqtr/index/type-aliases/OnRunAsyncFunction)\[]

Defined in: [src/classes/navigation/RoomStoredClass.ts:103](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/RoomStoredClass.ts#L103)

Get the functions that will be executed when the room is visited.

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

[`OnRunAsyncFunction`](/nqtr/index/type-aliases/OnRunAsyncFunction)\[]

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`automaticFunctions`](/nqtr/index/classes/RoomStoredClass#automaticfunctions)

***

### characters [#characters]

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

\> **get** **characters**(): `CharacterInterface`\[]

Defined in: [src/classes/navigation/RoomStoredClass.ts:96](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/RoomStoredClass.ts#L96)

Get the characters in the room.

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

`CharacterInterface`\[]

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`characters`](/nqtr/index/classes/RoomStoredClass#characters)

***

### disabled [#disabled]

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

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

Defined in: [src/classes/navigation/RoomBaseModel.ts:61](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/RoomBaseModel.ts#L61)

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

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

`boolean`

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

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

Defined in: [src/classes/navigation/RoomBaseModel.ts:68](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/RoomBaseModel.ts#L68)

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

###### value [#value]

`string` | `boolean`

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

`void`

***

### hidden [#hidden]

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

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

Defined in: [src/classes/navigation/RoomBaseModel.ts:76](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/RoomBaseModel.ts#L76)

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

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

`boolean`

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

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

Defined in: [src/classes/navigation/RoomBaseModel.ts:83](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/RoomBaseModel.ts#L83)

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

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

`string` | `boolean`

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

`void`

***

### icon [#icon]

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

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

Defined in: [src/classes/navigation/RoomBaseModel.ts:91](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/RoomBaseModel.ts#L91)

The function for rendering the icon of the room.

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

`string` | `undefined`

***

### image [#image]

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

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

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

The image of the room.

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

`string` | `undefined`

***

### location [#location-1]

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

\> **get** **location**(): [`LocationInterface`](/nqtr/index/interfaces/LocationInterface)

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

The location where the room is.

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

[`LocationInterface`](/nqtr/index/interfaces/LocationInterface)

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`location`](/nqtr/index/classes/RoomStoredClass#location)

***

### name [#name]

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

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

Defined in: [src/classes/navigation/RoomBaseModel.ts:42](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/RoomBaseModel.ts#L42)

The name.
If you set undefined, it will return the initial value of name.

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

`string`

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

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

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

##### Parameters [#parameters-3]

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

`string` | `undefined`

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

`void`

***

### routine [#routine]

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

\> **get** **routine**(): [`CommitmentInterface`](/nqtr/index/interfaces/CommitmentInterface)\[]

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

Get the character commitments of the room.

##### Returns [#returns-14]

[`CommitmentInterface`](/nqtr/index/interfaces/CommitmentInterface)\[]

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`routine`](/nqtr/index/classes/RoomStoredClass#routine)

## Methods [#methods]

### addActivity() [#addactivity]

\> **addActivity**(`activity`, `options?`): `void`

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

Connects the activity to the class.

#### Parameters [#parameters-4]

##### activity [#activity]

`string` | [`ActivityInterface`](/nqtr/index/interfaces/ActivityInterface)

The activity to connect to the class.

##### options? [#options]

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

#### Returns [#returns-15]

`void`

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`addActivity`](/nqtr/index/classes/RoomStoredClass#addactivity)

***

### addCommitment() [#addcommitment]

\> **addCommitment**(`commitment`, `options?`): `void`

Defined in: [src/classes/navigation/RoomStoredClass.ts:51](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/RoomStoredClass.ts#L51)

Connects the commitment to the class.

#### Parameters [#parameters-5]

##### commitment [#commitment]

`string` | [`CommitmentInterface`](/nqtr/index/interfaces/CommitmentInterface)

The commitment to connect to the class.

##### options? [#options-1]

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

#### Returns [#returns-16]

`void`

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`addCommitment`](/nqtr/index/classes/RoomStoredClass#addcommitment)

***

### clearExpiredActivities() [#clearexpiredactivities]

\> **clearExpiredActivities**(): `void`

Defined in: [src/classes/navigation/NavigationAbstractClass.ts:149](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/NavigationAbstractClass.ts#L149)

Removes the useless activities.

#### Returns [#returns-17]

`void`

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`clearExpiredActivities`](/nqtr/index/classes/RoomStoredClass#clearexpiredactivities)

***

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

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

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

***

### migrateOldStorage() [#migrateoldstorage]

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

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

#### Parameters [#parameters-7]

##### oldCategoryId? [#oldcategoryid]

`string`

#### Returns [#returns-19]

`void`

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`migrateOldStorage`](/nqtr/index/classes/RoomStoredClass#migrateoldstorage)

***

### removeActivity() [#removeactivity]

\> **removeActivity**(`activity`): `void`

Defined in: [src/classes/navigation/NavigationAbstractClass.ts:134](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/NavigationAbstractClass.ts#L134)

Disconnects the activity from the class.

#### Parameters [#parameters-8]

##### activity [#activity-1]

`string` | [`ActivityInterface`](/nqtr/index/interfaces/ActivityInterface)

The activity to disconnect from the class.

#### Returns [#returns-20]

`void`

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`removeActivity`](/nqtr/index/classes/RoomStoredClass#removeactivity)

***

### removeCommitment() [#removecommitment]

\> **removeCommitment**(`commitment`): `void`

Defined in: [src/classes/navigation/RoomStoredClass.ts:88](https://github.com/DRincs-Productions/nqtr/blob/db22fe9e7612d547ff25befcc444cf095348917d/src/classes/navigation/RoomStoredClass.ts#L88)

Disconnects the commitment from the class.

#### Parameters [#parameters-9]

##### commitment [#commitment-1]

`string` | [`CommitmentInterface`](/nqtr/index/interfaces/CommitmentInterface)

The commitment to disconnect from the class.

#### Returns [#returns-21]

`void`

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

[`RoomStoredClass`](/nqtr/index/classes/RoomStoredClass).[`removeCommitment`](/nqtr/index/classes/RoomStoredClass#removecommitment)

***

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

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

`string`

The name of the property to set.

##### value [#value-3]

`StorageElementType`

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

#### Returns [#returns-22]

`void`

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

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