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

#include <StructGen.h>

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

Public Member Functions

 cStructGenTrees (int a_Seed, cBiomeGen &a_BiomeGen, cTerrainShapeGen &a_ShapeGen, cTerrainCompositionGen &a_CompositionGen)
 
- Public Member Functions inherited from cFinishGen
virtual ~cFinishGen ()
 

Protected Member Functions

void ApplyTreeImage (int a_ChunkX, int a_ChunkZ, cChunkDesc &a_ChunkDesc, const sSetBlockVector &a_Image, sSetBlockVector &a_Overflow)
 Applies an image into chunk blockdata; all blocks outside the chunk will be appended to a_Overflow. More...
 
void GenerateSingleTree (int a_ChunkX, int a_ChunkZ, int a_Seq, Vector3i a_Pos, cChunkDesc &a_ChunkDesc, sSetBlockVector &a_OutsideLogs, sSetBlockVector &a_OutsideOther)
 Generates and applies an image of a single tree. More...
 
virtual void GenFinish (cChunkDesc &a_ChunkDesc) override
 
double GetNumTrees (int a_ChunkX, int a_ChunkZ, const cChunkDef::BiomeMap &a_Biomes)
 Get the the number of trees to generate in a_Chunk If the value is between 0 and 1, it should be interpreted as the probability that a tree should be generated. More...
 

Protected Attributes

cBiomeGenm_BiomeGen
 
cTerrainCompositionGenm_CompositionGen
 
cNoise m_Noise
 
int m_Seed
 
cTerrainShapeGenm_ShapeGen
 

Detailed Description

Definition at line 21 of file StructGen.h.

Constructor & Destructor Documentation

◆ cStructGenTrees()

cStructGenTrees::cStructGenTrees ( int  a_Seed,
cBiomeGen a_BiomeGen,
cTerrainShapeGen a_ShapeGen,
cTerrainCompositionGen a_CompositionGen 
)
inline

Definition at line 25 of file StructGen.h.

Member Function Documentation

◆ ApplyTreeImage()

void cStructGenTrees::ApplyTreeImage ( int  a_ChunkX,
int  a_ChunkZ,
cChunkDesc a_ChunkDesc,
const sSetBlockVector a_Image,
sSetBlockVector a_Overflow 
)
protected

Applies an image into chunk blockdata; all blocks outside the chunk will be appended to a_Overflow.

Definition at line 161 of file StructGen.cpp.

◆ GenerateSingleTree()

void cStructGenTrees::GenerateSingleTree ( int  a_ChunkX,
int  a_ChunkZ,
int  a_Seq,
Vector3i  a_Pos,
cChunkDesc a_ChunkDesc,
sSetBlockVector a_OutsideLogs,
sSetBlockVector a_OutsideOther 
)
protected

Generates and applies an image of a single tree.

Parts of the tree inside the chunk are applied to a_ChunkDesc. Parts of the tree outside the chunk are stored in a_OutsideXYZ

Definition at line 96 of file StructGen.cpp.

◆ GenFinish()

void cStructGenTrees::GenFinish ( cChunkDesc a_ChunkDesc)
overrideprotectedvirtual

Implements cFinishGen.

Definition at line 18 of file StructGen.cpp.

◆ GetNumTrees()

double cStructGenTrees::GetNumTrees ( int  a_ChunkX,
int  a_ChunkZ,
const cChunkDef::BiomeMap a_Biomes 
)
protected

Get the the number of trees to generate in a_Chunk If the value is between 0 and 1, it should be interpreted as the probability that a tree should be generated.

Definition at line 215 of file StructGen.cpp.

Member Data Documentation

◆ m_BiomeGen

cBiomeGen& cStructGenTrees::m_BiomeGen
protected

Definition at line 37 of file StructGen.h.

◆ m_CompositionGen

cTerrainCompositionGen& cStructGenTrees::m_CompositionGen
protected

Definition at line 39 of file StructGen.h.

◆ m_Noise

cNoise cStructGenTrees::m_Noise
protected

Definition at line 36 of file StructGen.h.

◆ m_Seed

int cStructGenTrees::m_Seed
protected

Definition at line 35 of file StructGen.h.

◆ m_ShapeGen

cTerrainShapeGen& cStructGenTrees::m_ShapeGen
protected

Definition at line 38 of file StructGen.h.


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