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

A simple cache that stores N most recently generated chunks' biomes; N being settable upon creation. More...

#include <BioGen.h>

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

Classes

struct  sCacheData
 

Public Member Functions

 cBioGenCache (cBiomeGenPtr a_BioGenToCache, size_t a_CacheSize)
 
virtual ~cBioGenCache () override=default
 
- Public Member Functions inherited from cBiomeGen
virtual ~cBiomeGen ()
 

Protected Member Functions

virtual void GenBiomes (cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
 Generates biomes for the given chunk. More...
 
virtual void InitializeBiomeGen (cIniFile &a_IniFile) override
 Reads parameters from the ini file, prepares generator for use. More...
 

Protected Attributes

cBiomeGenPtr m_BioGenToCache
 
std::vector< sCacheDatam_CacheData
 
std::vector< size_t > m_CacheOrder
 
size_t m_CacheSize
 
size_t m_NumHits
 
size_t m_NumMisses
 
size_t m_TotalChain
 

Private Types

typedef cBiomeGen super
 

Additional Inherited Members

- Static Public Member Functions inherited from cBiomeGen
static cBiomeGenPtr CreateBiomeGen (cIniFile &a_IniFile, int a_Seed, bool &a_CacheOffByDefault)
 Creates the correct BiomeGen descendant based on the ini file settings. More...
 

Detailed Description

A simple cache that stores N most recently generated chunks' biomes; N being settable upon creation.

Definition at line 45 of file BioGen.h.

Member Typedef Documentation

typedef cBiomeGen cBioGenCache::super
private

Definition at line 48 of file BioGen.h.

Constructor & Destructor Documentation

cBioGenCache::cBioGenCache ( cBiomeGenPtr  a_BioGenToCache,
size_t  a_CacheSize 
)

Definition at line 60 of file BioGen.cpp.

virtual cBioGenCache::~cBioGenCache ( )
overridevirtualdefault

Member Function Documentation

void cBioGenCache::GenBiomes ( cChunkCoords  a_ChunkCoords,
cChunkDef::BiomeMap a_BiomeMap 
)
overrideprotectedvirtual

Generates biomes for the given chunk.

Implements cBiomeGen.

Definition at line 79 of file BioGen.cpp.

void cBioGenCache::InitializeBiomeGen ( cIniFile a_IniFile)
overrideprotectedvirtual

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

Reimplemented from cBiomeGen.

Definition at line 130 of file BioGen.cpp.

Member Data Documentation

cBiomeGenPtr cBioGenCache::m_BioGenToCache
protected

Definition at line 58 of file BioGen.h.

std::vector<sCacheData> cBioGenCache::m_CacheData
protected

Definition at line 75 of file BioGen.h.

std::vector<size_t> cBioGenCache::m_CacheOrder
protected

Definition at line 74 of file BioGen.h.

size_t cBioGenCache::m_CacheSize
protected

Definition at line 73 of file BioGen.h.

size_t cBioGenCache::m_NumHits
protected

Definition at line 78 of file BioGen.h.

size_t cBioGenCache::m_NumMisses
protected

Definition at line 79 of file BioGen.h.

size_t cBioGenCache::m_TotalChain
protected

Definition at line 80 of file BioGen.h.


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