Esempio n. 1
0
 /// <summary>
 /// Gets the latest received position of a vessel
 /// </summary>
 public double[] GetLatestVesselPosition(Guid vesselId)
 {
     return(TargetVesselUpdateQueue.TryGetValue(vesselId, out var vesselPositionQueue) ?
            vesselPositionQueue.TryPeek(out var vesselPos) ? vesselPos.LatLonAlt :
            CurrentVesselUpdate.TryGetValue(vesselId, out vesselPos) ?
            vesselPos.LatLonAlt :
            null : null);
 }
        /// <summary>
        /// Checks if the given vessel id has position messages stored to be replayed
        /// </summary>
        public bool VesselHavePositionUpdatesQueued(Guid vesselId)
        {
            if (TargetVesselUpdateQueue.TryGetValue(vesselId, out var positionQueue))
            {
                return(positionQueue.Count > 0);
            }

            return(false);
        }