A class to represent one locomotive

Hierarchy

  • Loco

Constructors

  • Parameters

    • Optional name: string
    • Optional address: number

    Returns Loco

Properties

_direction: Direction = Direction.forward
_functions: boolean[] = []
_speed: number = 0
address: number
name: string

Accessors

  • get speed(): number
  • Returns number

  • set speed(newSpeed): void
  • Parameters

    • newSpeed: number

    Returns void

Methods

  • Parameters

    • functionNum: number

    Returns boolean

  • Parameters

    • functionNum: number
    • state: boolean

    Returns void

  • Returns string

  • Parameters

    • d: Record<string, unknown>

    Returns Loco

Generated using TypeDoc