Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Friends | 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 (cBiomeGen &a_BioGenToCache, size_t a_CacheSize)
 
- 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

cBiomeGenm_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

using Super = cBiomeGen
 

Friends

class cBioGenMulticache
 

Additional Inherited Members

- Static Public Member Functions inherited from cBiomeGen
static std::unique_ptr< cBiomeGenCreateBiomeGen (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

◆ Super

using cBioGenCache::Super = cBiomeGen
private

Definition at line 48 of file BioGen.h.

Constructor & Destructor Documentation

◆ cBioGenCache()

cBioGenCache::cBioGenCache ( cBiomeGen a_BioGenToCache,
size_t  a_CacheSize 
)

Definition at line 59 of file BioGen.cpp.

Member Function Documentation

◆ GenBiomes()

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

Generates biomes for the given chunk.

Implements cBiomeGen.

Definition at line 78 of file BioGen.cpp.

◆ InitializeBiomeGen()

void cBioGenCache::InitializeBiomeGen ( cIniFile a_IniFile)
overrideprotectedvirtual

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

Reimplemented from cBiomeGen.

Definition at line 129 of file BioGen.cpp.

Friends And Related Function Documentation

◆ cBioGenMulticache

friend class cBioGenMulticache
friend

Definition at line 56 of file BioGen.h.

Member Data Documentation

◆ m_BioGenToCache

cBiomeGen& cBioGenCache::m_BioGenToCache
protected

Definition at line 58 of file BioGen.h.

◆ m_CacheData

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

Definition at line 75 of file BioGen.h.

◆ m_CacheOrder

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

Definition at line 74 of file BioGen.h.

◆ m_CacheSize

size_t cBioGenCache::m_CacheSize
protected

Definition at line 73 of file BioGen.h.

◆ m_NumHits

size_t cBioGenCache::m_NumHits
protected

Definition at line 78 of file BioGen.h.

◆ m_NumMisses

size_t cBioGenCache::m_NumMisses
protected

Definition at line 79 of file BioGen.h.

◆ m_TotalChain

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: