Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | List of all members
cPiece::cVerticalStrategy Class Referenceabstract

Base class (interface) for strategies for placing the starting pieces vertically. More...

#include <PiecePool.h>

Inheritance diagram for cPiece::cVerticalStrategy:
Inheritance graph
[legend]

Public Member Functions

virtual void AssignGens (int a_Seed, cBiomeGen &a_BiomeGen, cTerrainHeightGen &a_TerrainHeightGen, int a_SeaLevel)
 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)=0
 Returns the Y coord of the piece. More...
 
virtual bool InitializeFromString (const AString &a_Params, bool a_LogWarnings)=0
 Initializes the strategy's parameters from the string representation. More...
 
virtual ~cVerticalStrategy ()
 

Detailed Description

Base class (interface) for strategies for placing the starting pieces vertically.

Descendants can override the GetVerticalPlacement() method to provide custom placement decisions.

Definition at line 100 of file PiecePool.h.

Constructor & Destructor Documentation

◆ ~cVerticalStrategy()

virtual cPiece::cVerticalStrategy::~cVerticalStrategy ( )
inlinevirtual

Definition at line 104 of file PiecePool.h.

Member Function Documentation

◆ AssignGens()

virtual void cPiece::cVerticalStrategy::AssignGens ( int  a_Seed,
cBiomeGen a_BiomeGen,
cTerrainHeightGen a_TerrainHeightGen,
int  a_SeaLevel 
)
inlinevirtual

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

Reimplemented in cVerticalStrategyRange, cVerticalStrategyTerrainOrOceanTop, and cVerticalStrategyTerrainTop.

Definition at line 118 of file PiecePool.h.

◆ GetVerticalPlacement()

virtual int cPiece::cVerticalStrategy::GetVerticalPlacement ( int  a_BlockX,
int  a_BlockZ 
)
pure virtual

◆ InitializeFromString()

virtual bool cPiece::cVerticalStrategy::InitializeFromString ( const AString a_Params,
bool  a_LogWarnings 
)
pure virtual

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.

Implemented in cVerticalStrategyTerrainOrOceanTop, cVerticalStrategyTerrainTop, cVerticalStrategyRange, and cVerticalStrategyFixed.


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