示例#1
0
        void Init(bool createGround)
        {
            Chunks = new Chunk[X_CHUNKS, Y_CHUNKS, Z_CHUNKS];

            for (int x = 0; x < X_CHUNKS; x++)
            {
                for (int y = 0; y < Y_CHUNKS; y++)
                {
                    for (int z = 0; z < Z_CHUNKS; z++)
                    {
                        Chunks[x, y, z] = new Chunk(this, x, y, z, createGround);
                    }
                }
            }
        }
示例#2
0
        internal void PadLeft()
        {
            for (int x = X_CHUNKS - 1;x>0 ; x--)
            {
                for (int y = 0; y < Y_CHUNKS; y++)
                {
                    for (int z = 0; z < Z_CHUNKS; z++)
                    {
                        Chunks[x, y, z] = Chunks[x - 1, y, z];
                        Chunks[x, y, z].worldX += 1;
                        Chunks[x, y, z].Updated = true;
                    }
                }
            }

            for (int y = 0; y < Y_CHUNKS; y++)
            {
                for (int z = 0; z < Z_CHUNKS; z++)
                {
                    Chunks[0, y, z] = new Chunk(this, 0, y, z, true);
                }
            }

            foreach (Spawn s in Spawns)
            {
                s.Position.X += Chunk.X_SIZE;
            }
        }