Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <PieceGeneratorBFSTree.h>
Classes | |
struct | cConnection |
The type used for storing a connection from one piece to another, while building the piece tree. More... | |
struct | cFreeConnector |
The type used for storing a pool of connectors that will be attempted to expand by another piece. More... | |
Public Member Functions | |
cPieceGeneratorBFSTree (cPiecePool &a_PiecePool, int a_Seed) | |
Creates a new object tied to the specified PiecePool, using the specified seed. More... | |
void | PlacePieces (int a_BlockX, int a_BlockZ, int a_MaxDepth, cPlacedPieces &a_OutPieces) |
Generates a placement for pieces at the specified coords. More... | |
Protected Types | |
typedef std::vector< cConnection > | cConnections |
typedef std::vector< cFreeConnector > | cFreeConnectors |
Protected Member Functions | |
bool | CheckConnection (const cPiece::cConnector &a_ExistingConnector, const Vector3i &a_ToPos, const cPiece &a_Piece, const cPiece::cConnector &a_NewConnector, int a_NumCCWRotations, const cPlacedPieces &a_OutPieces) |
Checks if the specified piece would fit with the already-placed pieces, using the specified connector and number of CCW rotations. More... | |
void | DebugConnectorPool (const cFreeConnectors &a_ConnectorPool, size_t a_NumProcessed) |
DEBUG: Outputs all the connectors in the pool into stdout. More... | |
cPlacedPiecePtr | PlaceStartingPiece (int a_BlockX, int a_BlockZ, cFreeConnectors &a_OutConnectors) |
Selects a starting piece and places it, including its height and rotation. More... | |
bool | TryPlacePieceAtConnector (const cPlacedPiece &a_ParentPiece, const cPiece::cConnector &a_Connector, cPlacedPieces &a_OutPieces, cFreeConnectors &a_OutConnectors) |
Tries to place a new piece at the specified (placed) connector. More... | |
Protected Attributes | |
cNoise | m_Noise |
The noise used for random number generation. More... | |
cPiecePool & | m_PiecePool |
The pool from which pieces are taken. More... | |
int | m_Seed |
The seed used by this generator. More... | |
Definition at line 19 of file PieceGeneratorBFSTree.h.
|
protected |
Definition at line 43 of file PieceGeneratorBFSTree.h.
|
protected |
Definition at line 54 of file PieceGeneratorBFSTree.h.
cPieceGeneratorBFSTree::cPieceGeneratorBFSTree | ( | cPiecePool & | a_PiecePool, |
int | a_Seed | ||
) |
Creates a new object tied to the specified PiecePool, using the specified seed.
Definition at line 22 of file PieceGeneratorBFSTree.cpp.
|
protected |
Checks if the specified piece would fit with the already-placed pieces, using the specified connector and number of CCW rotations.
a_ExistingConnector is in world-coords and is already rotated properly a_ToPos is the world-coords position on which the new connector should be placed (1 block away from a_ExistingConnector, in its Direction) a_NewConnector is in the original (non-rotated) coords. Returns true if the piece fits, false if not.
Definition at line 202 of file PieceGeneratorBFSTree.cpp.
|
protected |
DEBUG: Outputs all the connectors in the pool into stdout.
a_NumProcessed signals the number of connectors from the pool that should be considered processed (not listed).
Definition at line 293 of file PieceGeneratorBFSTree.cpp.
void cPieceGeneratorBFSTree::PlacePieces | ( | int | a_BlockX, |
int | a_BlockZ, | ||
int | a_MaxDepth, | ||
cPlacedPieces & | a_OutPieces | ||
) |
Generates a placement for pieces at the specified coords.
The Y coord is generated automatically based on the starting piece that is chosen.
Definition at line 228 of file PieceGeneratorBFSTree.cpp.
|
protected |
Selects a starting piece and places it, including its height and rotation.
Also puts the piece's connectors in a_OutConnectors.
Definition at line 33 of file PieceGeneratorBFSTree.cpp.
|
protected |
Tries to place a new piece at the specified (placed) connector.
Returns true if successful.
Definition at line 100 of file PieceGeneratorBFSTree.cpp.
|
protected |
The noise used for random number generation.
Definition at line 61 of file PieceGeneratorBFSTree.h.
|
protected |
The pool from which pieces are taken.
Definition at line 58 of file PieceGeneratorBFSTree.h.
|
protected |
The seed used by this generator.
Definition at line 64 of file PieceGeneratorBFSTree.h.