Cuberite
A lightweight, fast and extensible game server for Minecraft
|
The interface that all chunk generators must implement to provide the generated chunks. More...
#include <ChunkGenerator.h>
Public Member Functions | |
virtual void | Generate (cChunkDesc &a_ChunkDesc)=0 |
Does the actual chunk generation. More... | |
virtual void | GenerateBiomes (cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap)=0 |
Generates the biomes for the specified chunk. More... | |
virtual EMCSBiome | GetBiomeAt (int a_BlockX, int a_BlockZ) |
Returns the biome at the specified coords. More... | |
int | GetSeed (void) const |
Returns the seed that was read from the INI file. More... | |
virtual void | Initialize (cIniFile &a_IniFile) |
Called to initialize the generator on server startup. More... | |
virtual | ~cChunkGenerator () |
Static Public Member Functions | |
static std::unique_ptr< cChunkGenerator > | CreateFromIniFile (cIniFile &a_IniFile) |
Creates and initializes the entire generator based on the settings in the INI file. More... | |
Protected Attributes | |
eDimension | m_Dimension |
The dimension, read from the INI file. More... | |
int | m_Seed |
The main seed, read from the INI file, used for the entire generator. More... | |
The interface that all chunk generators must implement to provide the generated chunks.
Also a static factory that creates the descendants based on INI file settings. The cChunkGeneratorThread uses this interface to generate chunks for a single world. Ths calls to generate chunks are synchronous - they don't return until the chunk is fully generated.
Definition at line 20 of file ChunkGenerator.h.
|
inlinevirtual |
Definition at line 23 of file ChunkGenerator.h.
|
static |
Creates and initializes the entire generator based on the settings in the INI file.
Initializes the generator, so that it can be used immediately after this call returns.
Definition at line 36 of file ChunkGenerator.cpp.
|
pure virtual |
Does the actual chunk generation.
Descendants need to override this and generate into a_ChunkDesc.
Implemented in cNoise3DGenerator, and cComposableGenerator.
|
pure virtual |
Generates the biomes for the specified chunk.
Used by the world loader if biomes failed loading.
Implemented in cNoise3DGenerator, and cComposableGenerator.
|
virtual |
Returns the biome at the specified coords.
Used by ChunkMap if an invalid chunk is queried for biome. The default implementation uses GenerateBiomes().
Definition at line 68 of file ChunkGenerator.cpp.
|
inline |
Returns the seed that was read from the INI file.
Definition at line 43 of file ChunkGenerator.h.
|
virtual |
Called to initialize the generator on server startup.
Descendants should call Super::Initialize() before initializing themselves.
Reimplemented in cNoise3DGenerator, and cComposableGenerator.
Definition at line 15 of file ChunkGenerator.cpp.
|
protected |
The dimension, read from the INI file.
Definition at line 56 of file ChunkGenerator.h.
|
protected |
The main seed, read from the INI file, used for the entire generator.
Definition at line 53 of file ChunkGenerator.h.