Skip to main content

Class: ExistingUserWaypointsArray

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Navigation/ExistingUserWaypointsArray.ts:10

An array of all existing user waypoints. Each instance of this class is automatically updated to contain all existing user waypoints in the order in which they were added.

Extends​

  • AbstractSubscribableArray<FacilityWaypoint<UserFacility>>

Constructors​

Constructor​

new ExistingUserWaypointsArray(facRepo, bus, facWaypointCache): ExistingUserWaypointsArray

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Navigation/ExistingUserWaypointsArray.ts:27

Constructor.

Parameters​

ParameterTypeDescription
facRepoFacilityRepositoryThe facility repository.
busEventBusThe event bus.
facWaypointCacheFacilityWaypointCacheA cache from which to retrieve facility waypoints.

Returns​

ExistingUserWaypointsArray

Overrides​

AbstractSubscribableArray<FacilityWaypoint<UserFacility>>.constructor

Properties​

initialNotifyFunc()​

protected readonly initialNotifyFunc: (sub) => void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:20

A function which sends initial notifications to subscriptions.

Notifies a subscription of this array's current state.

Parameters​

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>The subscription to notify.

Returns​

void

Inherited from​

AbstractSubscribableArray.initialNotifyFunc


notifyDepth​

protected notifyDepth: number = 0

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:17

Inherited from​

AbstractSubscribableArray.notifyDepth


onSubDestroyedFunc()​

protected readonly onSubDestroyedFunc: (sub) => void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:23

A function which responds to when a subscription to this subscribable is destroyed.

Responds to when a subscription to this array is destroyed.

Parameters​

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>The destroyed subscription.

Returns​

void

Inherited from​

AbstractSubscribableArray.onSubDestroyedFunc


singletonSub?​

protected optional singletonSub: HandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:14

Inherited from​

AbstractSubscribableArray.singletonSub


subs?​

protected optional subs: HandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>[]

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:16

Inherited from​

AbstractSubscribableArray.subs

Accessors​

length​

Get Signature​

get length(): number

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Navigation/ExistingUserWaypointsArray.ts:15

Inherit Doc​
Returns​

number

Overrides​

AbstractSubscribableArray.length

Methods​

addSubscription()​

protected addSubscription(sub): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:29

Adds a subscription to this array.

Parameters​

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>The subscription to add.

Returns​

void

Inherited from​

AbstractSubscribableArray.addSubscription


destroy()​

destroy(): void

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Navigation/ExistingUserWaypointsArray.ts:70

Destroys this array. Once destroyed, the state of the array will no longer reflect all existing user waypoints.

Returns​

void


get()​

get(index): FacilityWaypoint

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:77

Gets an item from the array.

Parameters​

ParameterTypeDescription
indexnumberThex index of the item to get.

Returns​

FacilityWaypoint

An item.

Throws​

Inherited from​

AbstractSubscribableArray.get


getArray()​

getArray(): readonly FacilityWaypoint<UserFacility>[]

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Navigation/ExistingUserWaypointsArray.ts:41

Returns​

readonly FacilityWaypoint<UserFacility>[]

Inherit Doc​

Overrides​

AbstractSubscribableArray.getArray


initialNotify()​

protected initialNotify(sub): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:176

Notifies a subscription of this array's current state.

Parameters​

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>The subscription to notify.

Returns​

void

Inherited from​

AbstractSubscribableArray.initialNotify


notify()​

protected notify(index, type, modifiedItem?): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:100

Notifies subscriptions of a change in the array.

Parameters​

ParameterTypeDescription
indexnumberThe index that was changed.
typeSubscribableArrayEventTypeThe type of subject event.
modifiedItem?FacilityWaypoint<UserFacility> | readonly FacilityWaypoint<UserFacility>[]The item modified by the operation.

Returns​

void

Inherited from​

AbstractSubscribableArray.notify


onSubDestroyed()​

protected onSubDestroyed(sub): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:185

Responds to when a subscription to this array is destroyed.

Parameters​

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>The destroyed subscription.

Returns​

void

Inherited from​

AbstractSubscribableArray.onSubDestroyed


sub()​

sub(handler, initialNotify, paused): Subscription

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:41

Parameters​

ParameterTypeDefault value
handlerSubscribableArrayHandler<FacilityWaypoint<UserFacility>>undefined
initialNotifybooleanfalse
pausedbooleanfalse

Returns​

Subscription

Inherit Doc​

Inherited from​

AbstractSubscribableArray.sub


tryGet()​

tryGet(index): undefined | FacilityWaypoint<UserFacility>

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:90

Tries to get the value from the array.

Parameters​

ParameterTypeDescription
indexnumberThe index of the item to get.

Returns​

undefined | FacilityWaypoint<UserFacility>

The value or undefined if not found.

Inherited from​

AbstractSubscribableArray.tryGet


unsub()​

unsub(handler): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:56

Parameters​

ParameterType
handlerSubscribableArrayHandler<FacilityWaypoint<UserFacility>>

Returns​

void

Inherit Doc​

Inherited from​

AbstractSubscribableArray.unsub