Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Caches most-recently-used chunk composition of another composition generator. More...
#include <CompoGen.h>
Classes | |
struct | sCacheData |
Public Member Functions | |
cCompoGenCache (std::unique_ptr< cTerrainCompositionGen > a_Underlying, int a_CacheSize) | |
virtual void | ComposeTerrain (cChunkDesc &a_ChunkDesc, const cChunkDesc::Shape &a_Shape) override |
Generates the chunk's composition into a_ChunkDesc, using the terrain shape provided in a_Shape. More... | |
virtual void | InitializeCompoGen (cIniFile &a_IniFile) override |
Reads parameters from the ini file, prepares generator for use. More... | |
virtual | ~cCompoGenCache () override |
Public Member Functions inherited from cTerrainCompositionGen | |
virtual | ~cTerrainCompositionGen () |
Protected Attributes | |
sCacheData * | m_CacheData |
int * | m_CacheOrder |
int | m_CacheSize |
int | m_NumHits |
int | m_NumMisses |
int | m_TotalChain |
std::unique_ptr< cTerrainCompositionGen > | m_Underlying |
Additional Inherited Members | |
Static Public Member Functions inherited from 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 provided. More... | |
Caches most-recently-used chunk composition of another composition generator.
Caches only the types and metas
Definition at line 114 of file CompoGen.h.
cCompoGenCache::cCompoGenCache | ( | std::unique_ptr< cTerrainCompositionGen > | a_Underlying, |
int | a_CacheSize | ||
) |
Definition at line 332 of file CompoGen.cpp.
|
overridevirtual |
Definition at line 353 of file CompoGen.cpp.
|
overridevirtual |
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.
Implements cTerrainCompositionGen.
Definition at line 365 of file CompoGen.cpp.
|
overridevirtual |
Reads parameters from the ini file, prepares generator for use.
Reimplemented from cTerrainCompositionGen.
Definition at line 429 of file CompoGen.cpp.
|
protected |
Definition at line 141 of file CompoGen.h.
|
protected |
Definition at line 140 of file CompoGen.h.
|
protected |
Definition at line 139 of file CompoGen.h.
|
protected |
Definition at line 144 of file CompoGen.h.
|
protected |
Definition at line 145 of file CompoGen.h.
|
protected |
Definition at line 146 of file CompoGen.h.
|
protected |
Definition at line 127 of file CompoGen.h.