Class LocoStoreBaseAbstract

The base class for a LocoStore

Hierarchy

  • LocoStoreBase

Constructors

Properties

nameStore: Map<string, number>
objectStore: Map<number, Loco>

Methods

  • Adds a Loco to the LocoStore

    Parameters

    • loco: Loco

      The Loco to add to the LocoStore

    Returns void

  • Deletes a Loco from the store

    Parameters

    • identifier: string | number

      The identifier of the Loco to delete

    Returns boolean

    true if successful, false if not

  • Parameters

    • identifier: string | number

    Returns Promise<Loco>

  • Used to get a loco given either the name or address

    Parameters

    • identifier: LocoIdentifier

      Identifier of Loco to find

    Returns undefined | Loco

    {@link Loco} if found, undefined if not.

  • Updates a Loco in the store

    Parameters

    • identifier: LocoIdentifier

      The identifier of the Loco to update

    • Optional name: string

      The new name for the Loco

    • Optional address: number

      The new address for the Loco

    Returns void

Generated using TypeDoc