fBaseXtensions.Navigation.SkipAheadCache.RecordSkipAheadCachePoint C# (CSharp) Method

RecordSkipAheadCachePoint() public static method

public static RecordSkipAheadCachePoint ( float Precision = 20f ) : void
Precision float
return void
        public static void RecordSkipAheadCachePoint(float Precision = 20f)
        {
            double millisecondsLastRecord = DateTime.Now.Subtract(lastRecordedSkipAheadCache).TotalMilliseconds;

            if (millisecondsLastRecord < 100)
                return;
            // else if (millisecondsLastRecord>10000) //10 seconds.. clear cache!
            // SkipAheadAreaCache.Clear();

            if (SkipAheadAreaCache.Any(p => p.Position.Distance(ZetaDia.Me.Position) <= Precision))
                return;

            lastRecordedSkipAheadLocation = ZetaDia.Me.Position;

            SkipAheadAreaCache.Add(new SkipAheadNavigation(lastRecordedSkipAheadLocation, Precision));
            lastRecordedSkipAheadCache = DateTime.Now;
        }