Exemplo n.º 1
0
        public virtual void PopulateChunk(IChunkProvider par1IChunkProvider, IChunkProvider par2IChunkProvider, int par3, int par4)
        {
            if (!IsTerrainPopulated && par1IChunkProvider.ChunkExists(par3 + 1, par4 + 1) && par1IChunkProvider.ChunkExists(par3, par4 + 1) && par1IChunkProvider.ChunkExists(par3 + 1, par4))
            {
                par1IChunkProvider.Populate(par2IChunkProvider, par3, par4);
            }

            if (par1IChunkProvider.ChunkExists(par3 - 1, par4) && !par1IChunkProvider.ProvideChunk(par3 - 1, par4).IsTerrainPopulated&& par1IChunkProvider.ChunkExists(par3 - 1, par4 + 1) && par1IChunkProvider.ChunkExists(par3, par4 + 1) && par1IChunkProvider.ChunkExists(par3 - 1, par4 + 1))
            {
                par1IChunkProvider.Populate(par2IChunkProvider, par3 - 1, par4);
            }

            if (par1IChunkProvider.ChunkExists(par3, par4 - 1) && !par1IChunkProvider.ProvideChunk(par3, par4 - 1).IsTerrainPopulated&& par1IChunkProvider.ChunkExists(par3 + 1, par4 - 1) && par1IChunkProvider.ChunkExists(par3 + 1, par4 - 1) && par1IChunkProvider.ChunkExists(par3 + 1, par4))
            {
                par1IChunkProvider.Populate(par2IChunkProvider, par3, par4 - 1);
            }

            if (par1IChunkProvider.ChunkExists(par3 - 1, par4 - 1) && !par1IChunkProvider.ProvideChunk(par3 - 1, par4 - 1).IsTerrainPopulated&& par1IChunkProvider.ChunkExists(par3, par4 - 1) && par1IChunkProvider.ChunkExists(par3 - 1, par4))
            {
                par1IChunkProvider.Populate(par2IChunkProvider, par3 - 1, par4 - 1);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Populates chunk with ores etc etc
        /// </summary>
        public virtual void Populate(IChunkProvider par1IChunkProvider, int par2, int par3)
        {
            Chunk chunk = ProvideChunk(par2, par3);

            if (!chunk.IsTerrainPopulated)
            {
                chunk.IsTerrainPopulated = true;

                if (ChunkProvider != null)
                {
                    ChunkProvider.Populate(par1IChunkProvider, par2, par3);
                    chunk.SetChunkModified();
                }
            }
        }