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 direction(): Direction
  • Returns Direction

  • set direction(newDirection): void
  • Parameters

    • newDirection: Direction

    Returns void

  • 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

Generated using TypeDoc