Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Public Member Functions | Protected Types | Protected Attributes | Private Types | List of all members
cPieceStructuresGen::cGen Class Reference
Inheritance diagram for cPieceStructuresGen::cGen:
Inheritance graph
[legend]
Collaboration diagram for cPieceStructuresGen::cGen:
Collaboration graph
[legend]

Classes

struct  cConnection
 The type used for storing a connection from one piece to another, while building the piece tree. More...
 
struct  cFreeConnector
 The type used for storing a pool of connectors that will be attempted to expand by another piece. More...
 

Public Member Functions

 cGen (int a_Seed, cBiomeGen &a_BiomeGen, cTerrainHeightGen &a_HeightGen, int a_SeaLevel, const AString &a_Name)
 
virtual cStructurePtr CreateStructure (int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override
 Create a new structure at the specified gridpoint. More...
 
bool LoadFromFile (const AString &a_FileName)
 Loads the piecepool from a file. More...
 
- Public Member Functions inherited from cGridStructGen
 cGridStructGen (int a_Seed)
 Creates a new instance that has the generation parameters set to defaults. More...
 
 cGridStructGen (int a_Seed, int a_GridSizeX, int a_GridSizeZ, int a_MaxOffsetX, int a_MaxOffsetZ, int a_MaxStructureSizeX, int a_MaxStructureSizeZ, size_t a_MaxCacheSize)
 
virtual void GenFinish (cChunkDesc &a_ChunkDesc) override
 
void SetGeneratorParams (const AStringMap &a_GeneratorParams)
 Sets the generator params based on the dictionary passed in. More...
 
- Public Member Functions inherited from cFinishGen
virtual ~cFinishGen ()
 

Protected Types

typedef std::vector< cConnectioncConnections
 
typedef std::vector< cFreeConnectorcFreeConnectors
 

Protected Attributes

cBiomeGenm_BiomeGen
 The underlying biome generator that defines whether the structure is created or not. More...
 
cTerrainHeightGenm_HeightGen
 The underlying height generator, used to position the prefabs crossing chunk borders if they are set to FitGround. More...
 
int m_MaxDepth
 Maximum depth of the generated piece tree. More...
 
AString m_Name
 The name that is used for reporting. More...
 
cPrefabPiecePool m_PiecePool
 All available prefabs. More...
 
int m_SeaLevel
 The world's sea level, if available. More...
 
- Protected Attributes inherited from cGridStructGen
int m_BaseSeed
 Base seed of the world for which the generator generates chunk. More...
 
cStructurePtrs m_Cache
 Cache for the most recently generated structures, ordered by the recentness. More...
 
int m_GridSizeX
 The size of each grid's cell in the X axis. More...
 
int m_GridSizeZ
 The size of each grid's cell in the Z axis. More...
 
size_t m_MaxCacheSize
 Maximum allowed sum of costs for items in the cache. More...
 
int m_MaxOffsetX
 The maximum offset of the structure's origin from the grid midpoint, in X coord. More...
 
int m_MaxOffsetZ
 The maximum offset of the structure's origin from the grid midpoint, in Z coord. More...
 
int m_MaxStructureSizeX
 Maximum theoretical size of the structure in the X axis. More...
 
int m_MaxStructureSizeZ
 Maximum theoretical size of the structure in the Z axis. More...
 
cNoise m_Noise
 The noise used for generating grid offsets. More...
 
int m_Seed
 Seed for generating grid offsets and also available for descendants. More...
 

Private Types

using Super = cGridStructGen
 

Additional Inherited Members

- Public Types inherited from cGridStructGen
typedef std::shared_ptr< cStructurecStructurePtr
 
typedef std::list< cStructurePtrcStructurePtrs
 
- Protected Member Functions inherited from cGridStructGen
void ClearCache (void)
 Clears everything from the cache. More...
 
void GetStructuresForChunk (int a_ChunkX, int a_ChunkZ, cStructurePtrs &a_Structures)
 Returns all structures that may intersect the given chunk. More...
 

Detailed Description

Definition at line 16 of file PieceStructuresGen.cpp.

Member Typedef Documentation

◆ cConnections

typedef std::vector<cConnection> cPieceStructuresGen::cGen::cConnections
protected

Definition at line 84 of file PieceStructuresGen.cpp.

◆ cFreeConnectors

Definition at line 95 of file PieceStructuresGen.cpp.

◆ Super

Definition at line 19 of file PieceStructuresGen.cpp.

Constructor & Destructor Documentation

◆ cGen()

cPieceStructuresGen::cGen::cGen ( int  a_Seed,
cBiomeGen a_BiomeGen,
cTerrainHeightGen a_HeightGen,
int  a_SeaLevel,
const AString a_Name 
)
inline

Definition at line 23 of file PieceStructuresGen.cpp.

Member Function Documentation

◆ CreateStructure()

virtual cStructurePtr cPieceStructuresGen::cGen::CreateStructure ( int  a_GridX,
int  a_GridZ,
int  a_OriginX,
int  a_OriginZ 
)
inlineoverridevirtual

Create a new structure at the specified gridpoint.

Implements cGridStructGen.

Definition at line 63 of file PieceStructuresGen.cpp.

◆ LoadFromFile()

bool cPieceStructuresGen::cGen::LoadFromFile ( const AString a_FileName)
inline

Loads the piecepool from a file.

Returns true on success, logs warning and returns false on failure.

Definition at line 37 of file PieceStructuresGen.cpp.

Member Data Documentation

◆ m_BiomeGen

cBiomeGen& cPieceStructuresGen::cGen::m_BiomeGen
protected

The underlying biome generator that defines whether the structure is created or not.

Definition at line 98 of file PieceStructuresGen.cpp.

◆ m_HeightGen

cTerrainHeightGen& cPieceStructuresGen::cGen::m_HeightGen
protected

The underlying height generator, used to position the prefabs crossing chunk borders if they are set to FitGround.

Definition at line 101 of file PieceStructuresGen.cpp.

◆ m_MaxDepth

int cPieceStructuresGen::cGen::m_MaxDepth
protected

Maximum depth of the generated piece tree.

Definition at line 113 of file PieceStructuresGen.cpp.

◆ m_Name

AString cPieceStructuresGen::cGen::m_Name
protected

The name that is used for reporting.

Definition at line 107 of file PieceStructuresGen.cpp.

◆ m_PiecePool

cPrefabPiecePool cPieceStructuresGen::cGen::m_PiecePool
protected

All available prefabs.

Definition at line 110 of file PieceStructuresGen.cpp.

◆ m_SeaLevel

int cPieceStructuresGen::cGen::m_SeaLevel
protected

The world's sea level, if available.

Used for some cVerticalStrategy descendants.

Definition at line 104 of file PieceStructuresGen.cpp.


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