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

Base class for generators that have an ore list attached to them. More...

#include <FinishGen.h>

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

Classes

struct  OreInfo
 

Public Types

typedef std::vector< OreInfoOreInfos
 

Public Member Functions

 cFinishGenOres (int a_Seed, const OreInfos &a_OreInfos)
 
virtual void GenFinish (cChunkDesc &a_ChunkDesc) override
 
void SetSeed (int a_Seed)
 (Re-)sets the seed used by the internal generating mechanisms. More...
 
- Public Member Functions inherited from cFinishGen
virtual ~cFinishGen ()
 

Static Public Member Functions

static const OreInfosDefaultNaturalPatches (void)
 Returns a vector of OreInfo structures describing the default Overworld non-ore pockets (dirt, diorite etc), usable in the constructor. More...
 
static const OreInfosDefaultNetherOres (void)
 Returns a vector of OreInfo structures describing the default Nether ores, usable in the constructor. More...
 
static const OreInfosDefaultOverworldOres (void)
 Returns a vector of OreInfo structures describing the default Overworld ores, usable in the constructor. More...
 
static OreInfos OreInfosFromString (const AString &a_OreInfosString)
 Parses the parameter string into OreInfos array. More...
 
static AString OreInfosToString (const OreInfos &a_OreInfos)
 Returns a string that represents the OreInfos given as the parameter. More...
 

Protected Member Functions

virtual void GenerateOre (cChunkDesc &a_ChunkDesc, BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta, int a_MaxHeight, int a_NumNests, int a_NestSize, int a_Seq)=0
 Generates a single ore in the specified chunk image. More...
 

Protected Attributes

cNoise m_Noise
 The noise used for generating. More...
 
OreInfos m_OreInfos
 All the ores enabled in this generator. More...
 

Private Types

using Super = cFinishGen
 

Detailed Description

Base class for generators that have an ore list attached to them.

Provides the storage and parsing for the ore list, as well as the generic plumbing for generating individual ores. Descendants should override GenerateOre() to provide the specific ore generation technique. Note that this class uses the "Nest" terminology for individual packs of ore, it doesn't imply any shape or algorithm.

Definition at line 464 of file FinishGen.h.

Member Typedef Documentation

◆ OreInfos

typedef std::vector<OreInfo> cFinishGenOres::OreInfos

Definition at line 498 of file FinishGen.h.

◆ Super

Definition at line 467 of file FinishGen.h.

Constructor & Destructor Documentation

◆ cFinishGenOres()

cFinishGenOres::cFinishGenOres ( int  a_Seed,
const OreInfos a_OreInfos 
)
inline

Definition at line 500 of file FinishGen.h.

Member Function Documentation

◆ DefaultNaturalPatches()

const cFinishGenOres::OreInfos & cFinishGenOres::DefaultNaturalPatches ( void  )
static

Returns a vector of OreInfo structures describing the default Overworld non-ore pockets (dirt, diorite etc), usable in the constructor.

Definition at line 1790 of file FinishGen.cpp.

◆ DefaultNetherOres()

const cFinishGenOres::OreInfos & cFinishGenOres::DefaultNetherOres ( void  )
static

Returns a vector of OreInfo structures describing the default Nether ores, usable in the constructor.

Definition at line 1776 of file FinishGen.cpp.

◆ DefaultOverworldOres()

const cFinishGenOres::OreInfos & cFinishGenOres::DefaultOverworldOres ( void  )
static

Returns a vector of OreInfo structures describing the default Overworld ores, usable in the constructor.

Definition at line 1755 of file FinishGen.cpp.

◆ GenerateOre()

virtual void cFinishGenOres::GenerateOre ( cChunkDesc a_ChunkDesc,
BLOCKTYPE  a_OreType,
NIBBLETYPE  a_OreMeta,
int  a_MaxHeight,
int  a_NumNests,
int  a_NestSize,
int  a_Seq 
)
protectedpure virtual

Generates a single ore in the specified chunk image.

a_Seq is the sequencing number (used as a complement to seed to make each ore in the same chunk have different nests)

Implemented in cFinishGenOrePockets, and cFinishGenOreNests.

◆ GenFinish()

void cFinishGenOres::GenFinish ( cChunkDesc a_ChunkDesc)
overridevirtual

Implements cFinishGen.

Definition at line 1734 of file FinishGen.cpp.

◆ OreInfosFromString()

cFinishGenOres::OreInfos cFinishGenOres::OreInfosFromString ( const AString a_OreInfosString)
static

Parses the parameter string into OreInfos array.

See OreInfosToString() for the complementary function. Used for loading configuration from INI files.

Definition at line 1808 of file FinishGen.cpp.

◆ OreInfosToString()

AString cFinishGenOres::OreInfosToString ( const OreInfos a_OreInfos)
static

Returns a string that represents the OreInfos given as the parameter.

See OreInfosFromString() for the complementary function. Used for storing defaults in the INI file.

Definition at line 1852 of file FinishGen.cpp.

◆ SetSeed()

void cFinishGenOres::SetSeed ( int  a_Seed)

(Re-)sets the seed used by the internal generating mechanisms.

Definition at line 1873 of file FinishGen.cpp.

Member Data Documentation

◆ m_Noise

cNoise cFinishGenOres::m_Noise
protected

The noise used for generating.

Definition at line 533 of file FinishGen.h.

◆ m_OreInfos

OreInfos cFinishGenOres::m_OreInfos
protected

All the ores enabled in this generator.

Definition at line 536 of file FinishGen.h.


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