Exemplo n.º 1
0
    public void generateChunk(int x, int z)
    {
        Chunk chunk = new OverworldChunk();

        chunk.generate(125, x, z);
        this.chunkMap.set(x, z, chunk);
    }
Exemplo n.º 2
0
    void OverrideChunkWithThisSectorsVoxels(OverworldChunk ch, bool doOverride)
    {
        if (ch == null)
        {
            return;
        }
        if (ch.useOverridingSector == doOverride &&
            ch.overridingSector == this.Sector)
        {
            return;
        }
        ch.useOverridingSector = doOverride;
        ch.overridingSector    = this.Sector;

        OverworldTerrainEngine.Instance.ForceRegenerateTerrain(ch);
    }
Exemplo n.º 3
0
    void OverrideSectorWithThisSectorsVoxels(Index2 sector, bool doOverride)
    {
        OverworldTerrainEngine eng = OverworldTerrainEngine.Instance;

        OverworldChunk ch = eng.GetChunkForSector(sector) as OverworldChunk;

        if (ch != null)
        {
            OverrideChunkWithThisSectorsVoxels(ch, doOverride);

            OverworldChunk ch_down = ch.GetChunkDirectlyBelowThisChunk() as OverworldChunk;        // TODO: Better methods for getting neighbors
            if (ch_down != null)
            {
                OverrideChunkWithThisSectorsVoxels(ch_down, doOverride);
            }
        }
    }