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; }
private void HandleSensorIsDamagedChanged(Sensor sensor) { D.Log(ShowDebugLog, "{0}'s {1} is {2}.", DebugName, sensor.Name, sensor.IsDamaged ? "damaged" : "repaired"); RecalcSensorRange(); }
private void OnSensorIsOperationalChanged(Sensor sensor) { RecalcMaxSensorRange(); }
public void RemoveSensor(Sensor sensor) { D.Assert(Sensors.Contains(sensor)); D.Assert(!sensor.IsOperational); Sensors.Remove(sensor); sensor.onIsOperationalChanged -= OnSensorIsOperationalChanged; }