From b8fbba5eb92cda32b13d65f3704adf778da82f38 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 11 Nov 2015 10:32:42 +0100 Subject: Added PieceStructures generator. --- src/Generating/GridStructGen.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/Generating/GridStructGen.h') 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; -- cgit v1.2.3