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

A vertical strategy that places the piece within a range on top of the terrain or ocean, whichever's higher. More...

Inheritance diagram for cVerticalStrategyTerrainOrOceanTop:
Inheritance graph
[legend]
Collaboration diagram for cVerticalStrategyTerrainOrOceanTop:
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_SeaLevel
 The sea level used by the world. More...
 
int m_Seed
 Seed for the random generator. More...
 

Detailed Description

A vertical strategy that places the piece within a range on top of the terrain or ocean, whichever's higher.

Definition at line 223 of file VerticalStrategy.cpp.

Member Function Documentation

◆ AssignGens()

virtual void cVerticalStrategyTerrainOrOceanTop::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 253 of file VerticalStrategy.cpp.

◆ GetVerticalPlacement()

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

Returns the Y coord of the piece.

Implements cPiece::cVerticalStrategy.

Definition at line 228 of file VerticalStrategy.cpp.

◆ InitializeFromString()

virtual bool cVerticalStrategyTerrainOrOceanTop::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 244 of file VerticalStrategy.cpp.

Member Data Documentation

◆ m_HeightGen

cTerrainHeightGen* cVerticalStrategyTerrainOrOceanTop::m_HeightGen
protected

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

Definition at line 265 of file VerticalStrategy.cpp.

◆ m_MinRelHeight

int cVerticalStrategyTerrainOrOceanTop::m_MinRelHeight
protected

Minimum relative height at which the prefab is placed.

Definition at line 271 of file VerticalStrategy.cpp.

◆ m_RelHeightRange

int cVerticalStrategyTerrainOrOceanTop::m_RelHeightRange
protected

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

Definition at line 274 of file VerticalStrategy.cpp.

◆ m_SeaLevel

int cVerticalStrategyTerrainOrOceanTop::m_SeaLevel
protected

The sea level used by the world.

Definition at line 268 of file VerticalStrategy.cpp.

◆ m_Seed

int cVerticalStrategyTerrainOrOceanTop::m_Seed
protected

Seed for the random generator.

Definition at line 262 of file VerticalStrategy.cpp.


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