/// <summary> /// Empty method overriden in the pedestrian intersection classes. /// </summary> /// <param name="sensor"></param> public virtual void AddSensor(Sensor sensor) { }
/// <summary> /// Adds a <see cref="Sensor"/> to either the <see cref="PedestrianLight"/> or a <see cref="TrafficLight"/>. /// </summary> /// <param name="sensor">The <see cref="Sensor"/> to be added.</param> public override void AddSensor(Sensor sensor) { if (sensor is ZebraSensor) { this.HasPedestrianSensors = true; foreach (var pedestrianTrafficLight in this.PedestrianTrafficLights) { pedestrianTrafficLight.AttachSensor(sensor); } } }
/// <summary> /// Initializes the <see cref="Sensor"/> and puts the <see cref="PedestrianLight"/> on standby. /// </summary> public void AttachSensor(Sensor sensor) => this.Sensor = (ZebraSensor) sensor;