예제 #1
0
 public virtual void fireAlarm(SecurityZone zone, Sensor sensor)
 {
     Console.WriteLine(this.name + sensor.position + "水喷洒器打开了");
     if (parent != null)
     {
         parent.fireAlarm(zone, sensor);
     }
 }
예제 #2
0
 public override void fireAlarm(SecurityZone zone, Sensor sensor)
 {
     if (zone is Area)
     {
         Console.WriteLine("保安请马上去检查{0}的{1}", this.name, zone.name);
         if (GetParent() != null)
         {
             GetParent().fireAlarm(zone, sensor);
         }
         return;
     }
     base.fireAlarm(zone, sensor);
 }
예제 #3
0
 public override void fireAlarm(SecurityZone zone, Sensor sensor)
 {
     if (zone is Area)
     {
         Console.WriteLine("{0}栋大楼发生火警", name);
         if (GetParent() != null)
         {
             GetParent().fireAlarm(zone, sensor);
         }
         return;
     }
     base.fireAlarm(zone, sensor);
 }
예제 #4
0
 public void SetParent(SecurityZone zone)
 {
     this.parent = zone;
 }