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

Base class (interface) for the vertical limit of piece placement. More...

#include <PiecePool.h>

Inheritance diagram for cPiece::cVerticalLimit:
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 limits may bind to the underlying subgenerators. More...
 
virtual bool CanBeAtHeight (int a_BlockX, int a_BlockZ, int a_Height)=0
 Called to inquire whether the specified piece can be placed at the specified height. More...
 
virtual bool InitializeFromString (const AString &a_Params, bool a_LogWarnings)=0
 Initializes the limit's parameters from the string representation. More...
 
virtual ~cVerticalLimit ()
 

Detailed Description

Base class (interface) for the vertical limit of piece placement.

Each placed piece can have a limit, represented by this class, that gets queried for validity of the placement.

Definition at line 126 of file PiecePool.h.

Constructor & Destructor Documentation

◆ ~cVerticalLimit()

virtual cPiece::cVerticalLimit::~cVerticalLimit ( )
inlinevirtual

Definition at line 129 of file PiecePool.h.

Member Function Documentation

◆ AssignGens()

virtual void cPiece::cVerticalLimit::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 limits may bind to the underlying subgenerators.

Reimplemented in cVerticalLimitBelowTerrainOrOcean, cVerticalLimitBelowTerrain, cVerticalLimitAboveTerrainAndOcean, and cVerticalLimitAboveTerrain.

Definition at line 145 of file PiecePool.h.

◆ CanBeAtHeight()

virtual bool cPiece::cVerticalLimit::CanBeAtHeight ( int  a_BlockX,
int  a_BlockZ,
int  a_Height 
)
pure virtual

Called to inquire whether the specified piece can be placed at the specified height.

a_BlockX, a_BlockZ is the column of the connector that is being queried. a_Height is the requested height of the piece's lowest block.

Implemented in cVerticalLimitBelowTerrainOrOcean, cVerticalLimitBelowTerrain, cVerticalLimitBelow, cVerticalLimitAboveTerrainAndOcean, cVerticalLimitAboveTerrain, cVerticalLimitAbove, and cVerticalLimitNone.

◆ InitializeFromString()

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

Initializes the limit's parameters from the string representation.

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

Implemented in cVerticalLimitBelowTerrainOrOcean, cVerticalLimitBelowTerrain, cVerticalLimitBelow, cVerticalLimitAboveTerrainAndOcean, cVerticalLimitAboveTerrain, cVerticalLimitAbove, and cVerticalLimitNone.


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