private void HandleVesselUpdates() { if (!PositionUpdateSystemBasicReady) { return; } foreach (var keyVal in CurrentVesselUpdate) { if (!VesselCommon.DoVesselChecks(keyVal.Key)) { RemoveVesselFromSystem(keyVal.Key); } if (SettingsSystem.CurrentSettings.InterpolationEnabled) { keyVal.Value.ApplyInterpolatedVesselUpdate(); } else { keyVal.Value.ApplyVesselUpdate(); } } while (VesselsToRemove.Count > 0) { var vesselToRemove = VesselsToRemove.Dequeue(); TargetVesselUpdate.TryRemove(vesselToRemove, out _); CurrentVesselUpdate.TryRemove(vesselToRemove, out _); TargetVesselUpdateQueue.TryRemove(vesselToRemove, out _); } }
private static void HandleVesselUpdates() { foreach (var keyVal in CurrentVesselUpdate) { keyVal.Value.ApplyVesselUpdate(); } while (VesselsToRemove.Count > 0) { var vesselToRemove = VesselsToRemove.Dequeue(); TargetVesselUpdate.TryRemove(vesselToRemove, out _); CurrentVesselUpdate.TryRemove(vesselToRemove, out _); } }
private static void HandleVesselUpdates() { if (FlightGlobals.ActiveVessel == null) { return; } foreach (var keyVal in CurrentVesselUpdate) { keyVal.Value.ApplyVesselUpdate(); //FlightGlobals.ActiveVessel.StartCoroutine(ApplyVesselUpdate(keyVal.Value)); } while (VesselsToRemove.Count > 0) { var vesselToRemove = VesselsToRemove.Dequeue(); TargetVesselUpdate.TryRemove(vesselToRemove, out _); CurrentVesselUpdate.TryRemove(vesselToRemove, out _); } }
private void HandleVesselUpdates() { if (!PositionUpdateSystemBasicReady) { return; } foreach (var keyVal in CurrentVesselUpdate) { if (!DoVesselChecks(keyVal.Key)) { RemoveVesselFromSystem(keyVal.Key); } keyVal.Value.ApplyVesselUpdate(); } while (VesselsToRemove.Count > 0) { var vesselToRemove = VesselsToRemove.Dequeue(); TargetVesselUpdate.TryRemove(vesselToRemove, out _); CurrentVesselUpdate.TryRemove(vesselToRemove, out _); } }
/// <summary> /// Removes a vessel from the system /// </summary> public void RemoveVessel(Guid vesselId) { CurrentVesselUpdate.TryRemove(vesselId, out _); TargetVesselUpdateQueue.TryRemove(vesselId, out _); }