Beispiel #1
0
        // Create and load from file if exisiting
        private void LoadChunk(float x, float y)
        {
            GraphChunk gc = GetChunkAt(x, y);

            if (gc == null)
            {
                int ix, iy;
                GetChunkCoord(x, y, out ix, out iy);

                float base_x, base_y;
                GetChunkBase(ix, iy, out base_x, out base_y);

                gc     = new GraphChunk(base_x, base_y, ix, iy);
                gc.LRU = LRU++;


                CheckForChunkEvict();

                gc.Load(BaseDir + "\\" + Continent + "\\");
                chunks.Set(ix, iy, gc);
                ActiveChunks.Add(gc);
            }
        }
Beispiel #2
0
        // Create and load from file if exisiting
        private void LoadChunk(float x, float y)
        {
            GraphChunk gc = GetChunkAt(x, y);
            if (gc == null)
            {
                int ix, iy;
                GetChunkCoord(x, y, out ix, out iy);

                float base_x, base_y;
                GetChunkBase(ix, iy, out base_x, out base_y);

                gc = new GraphChunk(base_x, base_y, ix, iy);
                gc.LRU = LRU++;

                CheckForChunkEvict();

                gc.Load(BaseDir + "\\" + Continent + "\\");
                chunks.Set(ix, iy, gc);
                ActiveChunks.Add(gc);

            }
        }