Class ObjectManager<ObjectType, EventsType>Abstract

Type Parameters

  • ObjectType extends StringableObject & {
        addReferenceId(): void;
    }

  • EventsType

Hierarchy

  • Host<EventsType>

Implements

Constructors

  • Type Parameters

    • ObjectType extends object & {
          toString(): string;
      } & {
          addReferenceId(): void;
      }

    • EventsType

    Parameters

    • island: default
    • objects: SaferArray<ObjectType> = []

    Returns ObjectManager<ObjectType, EventsType>

Properties

event: IEventEmitter<ObjectManager<ObjectType, EventsType>, EventsType>
island: default
name: string

Name of this object manager

objects: SaferArray<ObjectType>

Accessors

  • get game(): Game
  • Returns Game

  • get length(): number
  • Returns number

  • set length(val: number): void
  • This is likely only used during save upgrades

    Parameters

    • val: number

    Returns void

Methods

  • Returns IteratorObject<undefined | ObjectType>

  • Called when this object manager is not used anymore (after it was saved!)

    Returns void

  • Returns number

  • Parameters

    • id: number

    Returns undefined | ObjectType

  • Returns SaferArray<ObjectType>

  • Parameters

    • object: SaferArray<ObjectType>

    Returns void

  • Returns void

  • Parameters

    • id: number
    • value: undefined | ObjectType

    Returns void

Generated using TypeDoc