MultiTrafficLight

trafficLight. MultiTrafficLight

A composite traffic light that combines all composed traffic lights. Does not track or raise any enabled or disabled events for the composed traffic lights.

Constructor

new MultiTrafficLight(trafficLights)

Source:
Parameters:
Name Type Description
trafficLights Array.<trafficLight.TrafficLight>

Traffic lights composed.

Extends

Members

green :trafficLight.Light

Description:
  • The green light.

Source:
Overrides:

The green light.

Type:

isAvailable :boolean

Description:
  • If the traffic light is available: enabled and not checked-out.

Source:
Overrides:

If the traffic light is available: enabled and not checked-out.

Type:
  • boolean

isCheckedOut :boolean

Description:
  • If the traffic light is checked-out or reserved.

Source:
Overrides:

If the traffic light is checked-out or reserved.

Type:
  • boolean

isEnabled :boolean

Description:
  • If any of the composed traffic lights is enabled.

Source:
Overrides:

If any of the composed traffic lights is enabled.

Type:
  • boolean

red :trafficLight.Light

Description:
  • The red light.

Source:
Overrides:

The red light.

Type:

yellow :trafficLight.Light

Description:
  • The yellow light.

Source:
Overrides:

The yellow light.

Type:

Methods

checkIn()

Description:
  • Checks-in the traffic light, making it available for checking out again.

Source:
Overrides:

checkOut() → {boolean}

Description:
  • Checks-out or reserve the traffic light for exclusive usage, making it unavailable for other users.

Source:
Overrides:
Returns:

True if the traffic light was successfully checked out. False if it was already checked out.

Type
boolean

reset()

Description:
  • Sets all lights to off.

Source:
Overrides:

Events

disabled

Description:
  • Traffic light disabled event.

Source:
Overrides:

enabled

Description:
  • Traffic light enabled event.

Source:
Overrides: