示例#1
0
 public void AddSensor(Sensor sensor) {
     D.Assert(sensor.RangeMonitor == null);
     D.Assert(!sensor.IsOperational);
     D.Assert(!Sensors.Contains(sensor));
     Sensors.Add(sensor);
     sensor.onIsOperationalChanged += OnSensorIsOperationalChanged;
 }
示例#2
0
 private void HandleSensorIsDamagedChanged(Sensor sensor) {
     D.Log(ShowDebugLog, "{0}'s {1} is {2}.", DebugName, sensor.Name, sensor.IsDamaged ? "damaged" : "repaired");
     RecalcSensorRange();
 }
示例#3
0
 private void OnSensorIsOperationalChanged(Sensor sensor) {
     RecalcMaxSensorRange();
 }
示例#4
0
 public void RemoveSensor(Sensor sensor) {
     D.Assert(Sensors.Contains(sensor));
     D.Assert(!sensor.IsOperational);
     Sensors.Remove(sensor);
     sensor.onIsOperationalChanged -= OnSensorIsOperationalChanged;
 }