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

A vertical strategy that places the piece in a specified range relative to the top of the terrain. More...

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

Public Member Functions

virtual void AssignGens (int a_Seed, cBiomeGen &a_BiomeGen, cTerrainHeightGen &a_HeightGen, int a_SeaLevel) override
 Called when the piece pool is assigned to a generator, so that the strategies may bind to the underlying subgenerators. More...
 
virtual int GetVerticalPlacement (int a_BlockX, int a_BlockZ) override
 Returns the Y coord of the piece. More...
 
virtual bool InitializeFromString (const AString &a_Params, bool a_LogWarnings) override
 Initializes the strategy's parameters from the string representation. More...
 
- Public Member Functions inherited from cPiece::cVerticalStrategy
virtual ~cVerticalStrategy ()
 

Protected Attributes

cTerrainHeightGenm_HeightGen
 Height generator from which the top of the terrain is read. More...
 
int m_MinRelHeight
 Minimum relative height at which the prefab is placed. More...
 
int m_RelHeightRange
 Range of the relative heights at which the prefab can be placed above the minimum. More...
 
int m_Seed
 Seed for the random generator. More...
 

Detailed Description

A vertical strategy that places the piece in a specified range relative to the top of the terrain.

Definition at line 169 of file VerticalStrategy.cpp.

Member Function Documentation

◆ AssignGens()

virtual void cVerticalStrategyTerrainTop::AssignGens ( int  a_Seed,
cBiomeGen a_BiomeGen,
cTerrainHeightGen a_TerrainHeightGen,
int  a_SeaLevel 
)
inlineoverridevirtual

Called when the piece pool is assigned to a generator, so that the strategies may bind to the underlying subgenerators.

Reimplemented from cPiece::cVerticalStrategy.

Definition at line 197 of file VerticalStrategy.cpp.

◆ GetVerticalPlacement()

virtual int cVerticalStrategyTerrainTop::GetVerticalPlacement ( int  a_BlockX,
int  a_BlockZ 
)
inlineoverridevirtual

Returns the Y coord of the piece.

Implements cPiece::cVerticalStrategy.

Definition at line 174 of file VerticalStrategy.cpp.

◆ InitializeFromString()

virtual bool cVerticalStrategyTerrainTop::InitializeFromString ( const AString a_Params,
bool  a_LogWarnings 
)
inlineoverridevirtual

Initializes the strategy's parameters from the string representation.

a_Params is the string containing only the parameters (substring after the first pipe character in the strategy description string). If a_LogWarnings is true, logs any problems to the console. Returns true if successful, false if the string parsing failed. Used when loading the strategy from a file.

Implements cPiece::cVerticalStrategy.

Definition at line 188 of file VerticalStrategy.cpp.

Member Data Documentation

◆ m_HeightGen

cTerrainHeightGen* cVerticalStrategyTerrainTop::m_HeightGen
protected

Height generator from which the top of the terrain is read.

Definition at line 208 of file VerticalStrategy.cpp.

◆ m_MinRelHeight

int cVerticalStrategyTerrainTop::m_MinRelHeight
protected

Minimum relative height at which the prefab is placed.

Definition at line 211 of file VerticalStrategy.cpp.

◆ m_RelHeightRange

int cVerticalStrategyTerrainTop::m_RelHeightRange
protected

Range of the relative heights at which the prefab can be placed above the minimum.

Definition at line 214 of file VerticalStrategy.cpp.

◆ m_Seed

int cVerticalStrategyTerrainTop::m_Seed
protected

Seed for the random generator.

Definition at line 205 of file VerticalStrategy.cpp.


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