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

A vertical strategy that places the piece in a random height between two heights. More...

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

Public Member Functions

virtual void AssignGens (int a_Seed, cBiomeGen &a_BiomeGen, cTerrainHeightGen &a_TerrainHeightGen, 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...
 
 cVerticalStrategyRange (void)
 
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

int m_Min
 Range for the random generator. More...
 
int m_Range
 
int m_Seed
 Seed for the random generator. More...
 

Detailed Description

A vertical strategy that places the piece in a random height between two heights.

Definition at line 107 of file VerticalStrategy.cpp.

Constructor & Destructor Documentation

◆ cVerticalStrategyRange()

cVerticalStrategyRange::cVerticalStrategyRange ( void  )
inline

Definition at line 111 of file VerticalStrategy.cpp.

Member Function Documentation

◆ AssignGens()

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

◆ GetVerticalPlacement()

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

Returns the Y coord of the piece.

Implements cPiece::cVerticalStrategy.

Definition at line 119 of file VerticalStrategy.cpp.

◆ InitializeFromString()

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

Member Data Documentation

◆ m_Min

int cVerticalStrategyRange::m_Min
protected

Range for the random generator.

Received in InitializeFromString().

Definition at line 160 of file VerticalStrategy.cpp.

◆ m_Range

int cVerticalStrategyRange::m_Range
protected

Definition at line 160 of file VerticalStrategy.cpp.

◆ m_Seed

int cVerticalStrategyRange::m_Seed
protected

Seed for the random generator.

Received in AssignGens().

Definition at line 157 of file VerticalStrategy.cpp.


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