Options
All
  • Public
  • Public/Protected
  • All
Menu

The central point for AtomCollections (= all subscriptions of an AggregatorValue) used in the StateManager. Basically, a map of AtomCollections, hashed via the AggregatorValue.

Hierarchy

  • AggregatorSubscriptionCollection

Index

Constructors

constructor

Properties

Private aggregatorMap

aggregatorMap: Map<string, AtomCollection> = ...

Internal datastructure. Hashmap that is accesed via an AggregatorValue's unique Id.

Readonly id

id: string

Unique Id of this collection.

Methods

addSubscription

  • Register a new subscription for an AggregatorValue.

    Parameters

    • aggValueId: string

      Unique Id of the AggregatorValue.

    • method: AggregatorMethod

      The aggregator method used for a new subscription.

    Returns string

    The unique id of the new subscription.

deleteSubscription

  • deleteSubscription(aggSubAtomId: string): void
  • Delete an existing subscription of an AggregatorValue.

    Parameters

    • aggSubAtomId: string

      The unique subscription Id that is going to be deleted.

    Returns void

getAllSubscriptions

  • Retrieves all existing subscriptions of all existing AggregatorValues.

    Returns SubscriptionAtom[]

    A single 1D list of all subscriptions.

getAtomFromAtomId

  • Retrieves a SubscriptionAtom given a unique Id.

    Parameters

    • aggSubAtomId: string

      Unique Id of the SubscriptionAtom.

    Returns undefined | SubscriptionAtom

    A SubscriptionAtom if it exists, undefined otherwise.

getCollectionFromAtomId

  • getCollectionFromAtomId(aggSubAtomId: string): undefined | string
  • Retrieves the unique Id of an AtomCollection that holds all subscriptions (= SubscriptionAtom) of an AggregatorValue.

    Parameters

    • aggSubAtomId: string

      Unique Id of the subscription whose AtomCollection that it lives in is looked for.

    Returns undefined | string

    Unique Id of an AtomCollection.

getSubscriptionList

  • Retrieves a list of subscriptions for an AggregatorValue.

    Parameters

    • aggValueId: string

      Unique Id of the AggregatorValue.

    Returns undefined | SubscriptionAtom[]

    List of subscriptions if it exists, undefined otherwise.

updateSubscriptionMethod

  • Updates an existing subscription with a new method it should use.

    Parameters

    • aggSubAtomId: string

      Unique Id of the subscription.

    • method: AggregatorMethod

      New mthod object that shall be used.

    Returns void

updateSubscriptionValues

  • Updates the values of all subscriptions an AggregatorValue has, i.e. when a player interacts with a module.

    Parameters

    • aggValueId: string

      Uniue Id of the AggregatorValue.

    • aggCollection: AggregatorCollection

      The AggregatorCollection that holds the new calculated values.

    Returns void

Static attributeTransformToClass

  • Workaround function to deserialize maps.

    Parameters

    • value: any

    Returns Map<string, AtomCollection>

Static attributeTransformToPlain

  • attributeTransformToPlain(value: any): object
  • Workaround to serialize maps.

    Parameters

    • value: any

    Returns object

Generated using TypeDoc