Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | List of all members
cComposableGenerator Class Reference

#include <ComposableGenerator.h>

Inheritance diagram for cComposableGenerator:
Inheritance graph
[legend]
Collaboration diagram for cComposableGenerator:
Collaboration graph
[legend]

Public Member Functions

 cComposableGenerator ()
 
virtual void Generate (cChunkDesc &a_ChunkDesc) override
 Does the actual chunk generation. More...
 
virtual void GenerateBiomes (cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
 Generates the biomes for the specified chunk. More...
 
virtual void Initialize (cIniFile &a_IniFile) override
 Called to initialize the generator on server startup. More...
 
- Public Member Functions inherited from cChunkGenerator
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 ~cChunkGenerator ()
 

Static Public Member Functions

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 dimension. More...
 
- Static Public Member Functions inherited from cChunkGenerator
static std::unique_ptr< cChunkGeneratorCreateFromIniFile (cIniFile &a_IniFile)
 Creates and initializes the entire generator based on the settings in the INI file. More...
 

Protected Member Functions

void InitBiomeGen (cIniFile &a_IniFile)
 Reads the BiomeGen settings from the ini and initializes m_BiomeGen accordingly. More...
 
void InitCompositionGen (cIniFile &a_IniFile)
 Reads the CompositionGen settings from the ini and initializes m_CompositionGen accordingly. More...
 
void InitFinishGens (cIniFile &a_IniFile)
 Reads the finishers from the ini and initializes m_FinishGens accordingly. More...
 
void InitShapeGen (cIniFile &a_IniFile)
 Reads the ShapeGen settings from the ini and initializes m_ShapeGen accordingly. More...
 

Protected Attributes

std::unique_ptr< cBiomeGenm_BiomeGen
 The biome generator. More...
 
std::unique_ptr< cTerrainHeightGenm_CompositedHeightCache
 The cache for the heights of the composited terrain. More...
 
std::unique_ptr< cTerrainCompositionGenm_CompositionGen
 The terrain composition generator. More...
 
std::vector< std::unique_ptr< cFinishGen > > m_FinishGens
 The finisher generators, in the order in which they are applied. More...
 
std::unique_ptr< cTerrainShapeGenm_ShapeGen
 The terrain shape generator. More...
 
- Protected Attributes inherited from cChunkGenerator
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...
 

Private Types

using Super = cChunkGenerator
 

Detailed Description

Definition at line 196 of file ComposableGenerator.h.

Member Typedef Documentation

◆ Super

Definition at line 199 of file ComposableGenerator.h.

Constructor & Destructor Documentation

◆ cComposableGenerator()

cComposableGenerator::cComposableGenerator ( )

Definition at line 118 of file ComposableGenerator.cpp.

Member Function Documentation

◆ Generate()

void cComposableGenerator::Generate ( cChunkDesc a_ChunkDesc)
overridevirtual

Does the actual chunk generation.

Descendants need to override this and generate into a_ChunkDesc.

Implements cChunkGenerator.

Definition at line 158 of file ComposableGenerator.cpp.

◆ GenerateBiomes()

void cComposableGenerator::GenerateBiomes ( cChunkCoords  a_ChunkCoords,
cChunkDef::BiomeMap a_BiomeMap 
)
overridevirtual

Generates the biomes for the specified chunk.

Used by the world loader if biomes failed loading.

Implements cChunkGenerator.

Definition at line 146 of file ComposableGenerator.cpp.

◆ InitBiomeGen()

void cComposableGenerator::InitBiomeGen ( cIniFile a_IniFile)
protected

Reads the BiomeGen settings from the ini and initializes m_BiomeGen accordingly.

Definition at line 283 of file ComposableGenerator.cpp.

◆ InitCompositionGen()

void cComposableGenerator::InitCompositionGen ( cIniFile a_IniFile)
protected

Reads the CompositionGen settings from the ini and initializes m_CompositionGen accordingly.

Definition at line 352 of file ComposableGenerator.cpp.

◆ InitFinishGens()

void cComposableGenerator::InitFinishGens ( cIniFile a_IniFile)
protected

Reads the finishers from the ini and initializes m_FinishGens accordingly.

Definition at line 378 of file ComposableGenerator.cpp.

◆ Initialize()

void cComposableGenerator::Initialize ( cIniFile a_IniFile)
overridevirtual

Called to initialize the generator on server startup.

Descendants should call Super::Initialize() before initializing themselves.

Reimplemented from cChunkGenerator.

Definition at line 129 of file ComposableGenerator.cpp.

◆ InitializeGeneratorDefaults()

void cComposableGenerator::InitializeGeneratorDefaults ( cIniFile a_IniFile,
eDimension  a_Dimension 
)
static

If there's no particular sub-generator set in the INI file, adds the default one, based on the dimension.

Definition at line 202 of file ComposableGenerator.cpp.

◆ InitShapeGen()

void cComposableGenerator::InitShapeGen ( cIniFile a_IniFile)
protected

Reads the ShapeGen settings from the ini and initializes m_ShapeGen accordingly.

Definition at line 319 of file ComposableGenerator.cpp.

Member Data Documentation

◆ m_BiomeGen

std::unique_ptr<cBiomeGen> cComposableGenerator::m_BiomeGen
protected

The biome generator.

Definition at line 219 of file ComposableGenerator.h.

◆ m_CompositedHeightCache

std::unique_ptr<cTerrainHeightGen> cComposableGenerator::m_CompositedHeightCache
protected

The cache for the heights of the composited terrain.

Definition at line 228 of file ComposableGenerator.h.

◆ m_CompositionGen

std::unique_ptr<cTerrainCompositionGen> cComposableGenerator::m_CompositionGen
protected

The terrain composition generator.

Definition at line 225 of file ComposableGenerator.h.

◆ m_FinishGens

std::vector<std::unique_ptr<cFinishGen> > cComposableGenerator::m_FinishGens
protected

The finisher generators, in the order in which they are applied.

Definition at line 231 of file ComposableGenerator.h.

◆ m_ShapeGen

std::unique_ptr<cTerrainShapeGen> cComposableGenerator::m_ShapeGen
protected

The terrain shape generator.

Definition at line 222 of file ComposableGenerator.h.


The documentation for this class was generated from the following files: