diff options
author | Mattes D <github@xoft.cz> | 2015-11-11 10:32:42 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-12-01 10:35:07 +0100 |
commit | b8fbba5eb92cda32b13d65f3704adf778da82f38 (patch) | |
tree | 0c6e8f47ae152e5ffade6f0a7457505101764753 /src/Generating/GridStructGen.h | |
parent | Merge pull request #2696 from Gargaj/breeding (diff) | |
download | cuberite-b8fbba5eb92cda32b13d65f3704adf778da82f38.tar cuberite-b8fbba5eb92cda32b13d65f3704adf778da82f38.tar.gz cuberite-b8fbba5eb92cda32b13d65f3704adf778da82f38.tar.bz2 cuberite-b8fbba5eb92cda32b13d65f3704adf778da82f38.tar.lz cuberite-b8fbba5eb92cda32b13d65f3704adf778da82f38.tar.xz cuberite-b8fbba5eb92cda32b13d65f3704adf778da82f38.tar.zst cuberite-b8fbba5eb92cda32b13d65f3704adf778da82f38.zip |
Diffstat (limited to 'src/Generating/GridStructGen.h')
-rw-r--r-- | src/Generating/GridStructGen.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/Generating/GridStructGen.h b/src/Generating/GridStructGen.h index b92fb2e9d..b27f218f4 100644 --- a/src/Generating/GridStructGen.h +++ b/src/Generating/GridStructGen.h @@ -85,9 +85,24 @@ public: int a_MaxStructureSizeX, int a_MaxStructureSizeZ, size_t a_MaxCacheSize ); + + /** Creates a new instance that has the generation parameters set to defaults. + This is used for instances that are later loaded from a file. */ + cGridStructGen(int a_Seed); + + /** Sets the generator params based on the dictionary passed in. + Note that this must not be called anymore after generating a chunk. */ + void SetGeneratorParams(const AStringMap & a_GeneratorParams); + + // cFinishGen override: + virtual void GenFinish(cChunkDesc & a_ChunkDesc) override; protected: - /** Seed for generating grid offsets and also available for descendants. */ + /** Base seed of the world for which the generator generates chunk. */ + int m_BaseSeed; + + /** Seed for generating grid offsets and also available for descendants. + Calculated from m_BaseSeed by adding the SeedOffset parameter loaded from the cubeset file (if applicable); otherwise the same as m_BaseSeed. */ int m_Seed; /** The noise used for generating grid offsets. */ @@ -131,9 +146,6 @@ protected: around their gridpoint intersects the chunk. */ void GetStructuresForChunk(int a_ChunkX, int a_ChunkZ, cStructurePtrs & a_Structures); - // cFinishGen overrides: - virtual void GenFinish(cChunkDesc & a_ChunkDesc) override; - // Functions for the descendants to override: /** Create a new structure at the specified gridpoint */ virtual cStructurePtr CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) = 0; |