Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Base class for generators that have an ore list attached to them. More...
#include <FinishGen.h>
Classes | |
struct | OreInfo |
Public Types | |
typedef std::vector< OreInfo > | OreInfos |
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 OreInfos & | DefaultNaturalPatches (void) |
Returns a vector of OreInfo structures describing the default Overworld non-ore pockets (dirt, diorite etc), usable in the constructor. More... | |
static const OreInfos & | DefaultNetherOres (void) |
Returns a vector of OreInfo structures describing the default Nether ores, usable in the constructor. More... | |
static const OreInfos & | DefaultOverworldOres (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 |
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.
typedef std::vector<OreInfo> cFinishGenOres::OreInfos |
Definition at line 498 of file FinishGen.h.
|
private |
Definition at line 467 of file FinishGen.h.
|
inline |
Definition at line 500 of file FinishGen.h.
|
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.
|
static |
Returns a vector of OreInfo structures describing the default Nether ores, usable in the constructor.
Definition at line 1776 of file FinishGen.cpp.
|
static |
Returns a vector of OreInfo structures describing the default Overworld ores, usable in the constructor.
Definition at line 1755 of file FinishGen.cpp.
|
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.
|
overridevirtual |
Implements cFinishGen.
Definition at line 1734 of file FinishGen.cpp.
|
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.
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.
void cFinishGenOres::SetSeed | ( | int | a_Seed | ) |
(Re-)sets the seed used by the internal generating mechanisms.
Definition at line 1873 of file FinishGen.cpp.
|
protected |
The noise used for generating.
Definition at line 533 of file FinishGen.h.
|
protected |
All the ores enabled in this generator.
Definition at line 536 of file FinishGen.h.