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

The interface that is used to query terrain height from the shape generator. More...

#include <ComposableGenerator.h>

Inheritance diagram for cTerrainHeightGen:
Inheritance graph
[legend]

Public Member Functions

virtual void GenHeightMap (cChunkCoords a_ChunkCoords, cChunkDef::HeightMap &a_HeightMap)=0
 Retrieves the heightmap for the specified chunk. More...
 
virtual HEIGHTTYPE GetHeightAt (int a_BlockX, int a_BlockZ)
 Returns the height at the specified column. More...
 
virtual void InitializeHeightGen (cIniFile &a_IniFile)
 Initializes the generator, reading its parameters from the INI file. More...
 
virtual ~cTerrainHeightGen ()
 

Static Public Member Functions

static std::unique_ptr< cTerrainHeightGenCreateHeightGen (cIniFile &a_IniFile, cBiomeGen &a_BiomeGen, int a_Seed, bool &a_CacheOffByDefault)
 Creates a cTerrainHeightGen descendant based on the INI file settings. More...
 

Detailed Description

The interface that is used to query terrain height from the shape generator.

Usually the structure generators require only the final heightmap, and generating the whole shape only to consume the heightmap is wasteful, so this interface is used instead; it has a cache implemented over it so that data is retained.

Definition at line 110 of file ComposableGenerator.h.

Constructor & Destructor Documentation

◆ ~cTerrainHeightGen()

virtual cTerrainHeightGen::~cTerrainHeightGen ( )
inlinevirtual

Definition at line 113 of file ComposableGenerator.h.

Member Function Documentation

◆ CreateHeightGen()

std::unique_ptr< cTerrainHeightGen > cTerrainHeightGen::CreateHeightGen ( cIniFile a_IniFile,
cBiomeGen a_BiomeGen,
int  a_Seed,
bool &  a_CacheOffByDefault 
)
static

Creates a cTerrainHeightGen descendant based on the INI file settings.

Definition at line 835 of file HeiGen.cpp.

◆ GenHeightMap()

virtual void cTerrainHeightGen::GenHeightMap ( cChunkCoords  a_ChunkCoords,
cChunkDef::HeightMap a_HeightMap 
)
pure virtual

Retrieves the heightmap for the specified chunk.

Implemented in cHeiGenBiomal, cHeiGenMountains, cHeiGenClassic, cHeiGenFlat, cHeiGenMultiCache, cHeiGenCache, cHeiGenMinMax, cHeiGenSteppy, and cCompositedHeiGen.

◆ GetHeightAt()

virtual HEIGHTTYPE cTerrainHeightGen::GetHeightAt ( int  a_BlockX,
int  a_BlockZ 
)
inlinevirtual

Returns the height at the specified column.

The default implementation calls GenHeightMap(), and then queries the heightmap. Descendants may provide a better-performing method.

Reimplemented in cHeiGenBiomal, cHeiGenMultiCache, and cHeiGenCache.

Definition at line 124 of file ComposableGenerator.h.

◆ InitializeHeightGen()

virtual void cTerrainHeightGen::InitializeHeightGen ( cIniFile a_IniFile)
inlinevirtual

Initializes the generator, reading its parameters from the INI file.

Reimplemented in cHeiGenBiomal, cHeiGenMountains, cHeiGenClassic, cHeiGenFlat, and cHeiGenMinMax.

Definition at line 119 of file ComposableGenerator.h.


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