예제 #1
0
 /// <summary>
 ///  Empty method overriden in the pedestrian intersection classes.
 /// </summary>
 /// <param name="sensor"></param>
 public virtual void AddSensor(Sensor sensor) { }
예제 #2
0
 /// <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);
         }
     }
  
 }
예제 #3
0
 /// <summary>
 /// Initializes the <see cref="Sensor"/> and puts the <see cref="PedestrianLight"/> on standby.
 /// </summary>
 public void AttachSensor(Sensor sensor) => this.Sensor = (ZebraSensor) sensor;