Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Static Public Member Functions | List of all members
cTerrainCompositionGen Class Referenceabstract

The interface that a terrain composition generator must implement Terrain composition takes chunk coords on input and outputs the blockdata for that entire chunk, along with the list of entities. More...

#include <ComposableGenerator.h>

Inheritance diagram for cTerrainCompositionGen:
Inheritance graph
[legend]

Public Member Functions

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. More...
 
virtual void InitializeCompoGen (cIniFile &a_IniFile)
 Reads parameters from the ini file, prepares generator for use. More...
 
virtual ~cTerrainCompositionGen ()
 

Static Public Member Functions

static std::unique_ptr< cTerrainCompositionGenCreateCompositionGen (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 provided. More...
 

Detailed Description

The interface that a terrain composition generator must implement Terrain composition takes chunk coords on input and outputs the blockdata for that entire chunk, along with the list of entities.

It is supposed to make use of the underlying TerrainHeightGen and BiomeGen for that purpose, but it may request information for other chunks than the one it's currently generating from them.

Definition at line 150 of file ComposableGenerator.h.

Constructor & Destructor Documentation

◆ ~cTerrainCompositionGen()

virtual cTerrainCompositionGen::~cTerrainCompositionGen ( )
inlinevirtual

Definition at line 153 of file ComposableGenerator.h.

Member Function Documentation

◆ ComposeTerrain()

virtual void cTerrainCompositionGen::ComposeTerrain ( cChunkDesc a_ChunkDesc,
const cChunkDesc::Shape a_Shape 
)
pure virtual

Generates the chunk's composition into a_ChunkDesc, using the terrain shape provided in a_Shape.

Is expected to fill a_ChunkDesc's heightmap with the data from a_Shape.

Implemented in cEndGen, cCompoGenBiomal, cCompoGenCache, cCompoGenNether, cCompoGenClassic, cCompoGenDebugBiomes, and cCompoGenSameBlock.

◆ CreateCompositionGen()

std::unique_ptr< cTerrainCompositionGen > cTerrainCompositionGen::CreateCompositionGen ( cIniFile a_IniFile,
cBiomeGen a_BiomeGen,
cTerrainShapeGen a_ShapeGen,
int  a_Seed 
)
static

Creates the correct TerrainCompositionGen descendant based on the ini file settings and the seed provided.

a_BiomeGen is the underlying biome generator, some composition generators may depend on it providing additional biomes around the chunk a_ShapeGen is the underlying shape generator, some composition generators may depend on it providing additional shape around the chunk.

Definition at line 42 of file ComposableGenerator.cpp.

◆ InitializeCompoGen()

virtual void cTerrainCompositionGen::InitializeCompoGen ( cIniFile a_IniFile)
inlinevirtual

Reads parameters from the ini file, prepares generator for use.

Reimplemented in cCompoGenBiomal, cCompoGenCache, cCompoGenNether, cCompoGenClassic, and cCompoGenSameBlock.

Definition at line 160 of file ComposableGenerator.h.


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