61 bool & a_CacheOffByDefault
98 bool & a_CacheOffByDefault
137 bool & a_CacheOffByDefault
unsigned char HEIGHTTYPE
The type used by the heightmap.
eDimension
Dimension of a world.
Wraps the chunk coords into a single structure.
static void BlockToChunk(int a_X, int a_Z, int &a_ChunkX, int &a_ChunkZ)
Converts absolute block coords to chunk coords:
HEIGHTTYPE HeightMap[Width *Width]
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the hig...
static HEIGHTTYPE GetHeight(const HeightMap &a_HeightMap, int a_X, int a_Z)
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
Byte Shape[256 *16 *16]
The datatype used to represent the entire chunk worth of shape.
The interface that all chunk generators must implement to provide the generated chunks.
The interface that a biome generator must implement A biome generator takes chunk coords on input and...
virtual void InitializeBiomeGen(cIniFile &a_IniFile)
Reads parameters from the ini file, prepares generator for use.
static std::unique_ptr< cBiomeGen > CreateBiomeGen(cIniFile &a_IniFile, int a_Seed, bool &a_CacheOffByDefault)
Creates the correct BiomeGen descendant based on the ini file settings.
virtual void GenBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap)=0
Generates biomes for the given chunk.
The interface that a terrain shape generator must implement A terrain shape generator takes chunk coo...
virtual ~cTerrainShapeGen()
static std::unique_ptr< cTerrainShapeGen > CreateShapeGen(cIniFile &a_IniFile, cBiomeGen &a_BiomeGen, int a_Seed, bool &a_CacheOffByDefault)
Creates the correct TerrainShapeGen descendant based on the ini file settings and the seed provided.
virtual void GenShape(cChunkCoords a_ChunkCoords, cChunkDesc::Shape &a_Shape)=0
Generates the shape for the given chunk.
virtual void InitializeShapeGen(cIniFile &a_IniFile)
Reads parameters from the ini file, prepares generator for use.
The interface that is used to query terrain height from the shape generator.
virtual void GenHeightMap(cChunkCoords a_ChunkCoords, cChunkDef::HeightMap &a_HeightMap)=0
Retrieves the heightmap for the specified chunk.
static std::unique_ptr< cTerrainHeightGen > CreateHeightGen(cIniFile &a_IniFile, cBiomeGen &a_BiomeGen, int a_Seed, bool &a_CacheOffByDefault)
Creates a cTerrainHeightGen descendant based on the INI file settings.
virtual void InitializeHeightGen(cIniFile &a_IniFile)
Initializes the generator, reading its parameters from the INI file.
virtual ~cTerrainHeightGen()
virtual HEIGHTTYPE GetHeightAt(int a_BlockX, int a_BlockZ)
Returns the height at the specified column.
The interface that a terrain composition generator must implement Terrain composition takes chunk coo...
virtual void ComposeTerrain(cChunkDesc &a_ChunkDesc, const cChunkDesc::Shape &a_Shape)=0
Generates the chunk's composition into a_ChunkDesc, using the terrain shape provided in a_Shape.
virtual void InitializeCompoGen(cIniFile &a_IniFile)
Reads parameters from the ini file, prepares generator for use.
virtual ~cTerrainCompositionGen()
static std::unique_ptr< cTerrainCompositionGen > CreateCompositionGen(cIniFile &a_IniFile, cBiomeGen &a_BiomeGen, cTerrainShapeGen &a_ShapeGen, int a_Seed)
Creates the correct TerrainCompositionGen descendant based on the ini file settings and the seed prov...
The interface that a finisher must implement Finisher implements changes to the chunk after the rough...
virtual void GenFinish(cChunkDesc &a_ChunkDesc)=0
virtual void GenerateBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
Generates the biomes for the specified chunk.
virtual void Initialize(cIniFile &a_IniFile) override
Called to initialize the generator on server startup.
void InitFinishGens(cIniFile &a_IniFile)
Reads the finishers from the ini and initializes m_FinishGens accordingly.
static void InitializeGeneratorDefaults(cIniFile &a_IniFile, eDimension a_Dimension)
If there's no particular sub-generator set in the INI file, adds the default one, based on the dimens...
std::unique_ptr< cBiomeGen > m_BiomeGen
The biome generator.
std::vector< std::unique_ptr< cFinishGen > > m_FinishGens
The finisher generators, in the order in which they are applied.
std::unique_ptr< cTerrainShapeGen > m_ShapeGen
The terrain shape generator.
std::unique_ptr< cTerrainHeightGen > m_CompositedHeightCache
The cache for the heights of the composited terrain.
void InitShapeGen(cIniFile &a_IniFile)
Reads the ShapeGen settings from the ini and initializes m_ShapeGen accordingly.
void InitBiomeGen(cIniFile &a_IniFile)
Reads the BiomeGen settings from the ini and initializes m_BiomeGen accordingly.
std::unique_ptr< cTerrainCompositionGen > m_CompositionGen
The terrain composition generator.
virtual void Generate(cChunkDesc &a_ChunkDesc) override
Does the actual chunk generation.
void InitCompositionGen(cIniFile &a_IniFile)
Reads the CompositionGen settings from the ini and initializes m_CompositionGen accordingly.