Esempio n. 1
0
        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 _);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Removes a vessel from the system
 /// </summary>
 public void RemoveVessel(Guid vesselId)
 {
     CurrentVesselUpdate.TryRemove(vesselId, out _);
     TargetVesselUpdateQueue.TryRemove(vesselId, out _);
 }