Beispiel #1
0
        private void CheckForChunkEvict()
        {
            lock (this)
            {
                if (ActiveChunks.Count < 25)
                {
                    return;
                }

                GraphChunk evict = null;
                foreach (GraphChunk gc in ActiveChunks)
                {
                    if (evict == null || gc.LRU < evict.LRU)
                    {
                        evict = gc;
                    }
                }

                // It is full!
                evict.Save(BaseDir + "\\" + Continent + "\\");
                ActiveChunks.Remove(evict);
                chunks.Clear(evict.ix, evict.iy);
                evict.Clear();
            }
        }