Aggregated TrafficLight States
When a driver approaches a traffic light, they want to know if they need to stop. To do so, they need to check each individual light bulb to see if any of them has is both turned on and red.
osiql aggregates light bulbs, but does not aggregate the states of its bulbs. This PR adds TrafficLight::GetState
, which can be used to quickly check for common states of an entire traffic light (red, red and yellow, green, yellow).
Many specific states are not yet covered, such as blinking lights for instance, but those can be added in the future.
Additionally, the memory footprint of traffic lights is reduced and osiql::LightBulb
is added. A osiql::TrafficLight
now sorts its bulbs by color.