Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <PiecePool.h>
Public Types | |
enum | eDirection { dirXM = BLOCK_FACE_XM , dirXP = BLOCK_FACE_XP , dirYM = BLOCK_FACE_YM , dirYP = BLOCK_FACE_YP , dirZM = BLOCK_FACE_ZM , dirZP = BLOCK_FACE_ZP , dirYM_XM_ZM = BLOCK_FACE_MAX + 1 , dirYM_XM_ZP , dirYM_XP_ZM , dirYM_XP_ZP , dirYP_XM_ZM , dirYP_XM_ZP , dirYP_XP_ZM , dirYP_XP_ZP } |
Public Member Functions | |
cConnector (const Vector3i &a_Pos, int a_Type, eDirection a_Direction) | |
cConnector (int a_X, int a_Y, int a_Z, int a_Type, eDirection a_Direction) | |
Static Public Member Functions | |
static Vector3i | AddDirection (const Vector3i &a_Pos, eDirection a_Direction) |
Returns the position of the block that has the specified direction from the specified position. More... | |
static const char * | DirectionToString (eDirection a_Direction) |
Returns the string representation of the direction. More... | |
static int | GetNumCCWRotationsToFit (eDirection a_FixedDir, eDirection a_RotatingDir) |
Returns the number of CCW rotations that a_RotatingDir requires in order to be the counter-direction of a_FixedDir. More... | |
static bool | IsValidDirection (int a_Direction) |
Returns true if the specified number corresponds to a valid eDirection. More... | |
static eDirection | RotateDirection (eDirection a_Direction) |
Returns the direction corresponding to the given direction rotated 180 degrees around the Y axis. More... | |
static eDirection | RotateDirectionCCW (eDirection a_Direction) |
Returns the direction corresponding to the given direction rotated 90 degrees CCW around the Y axis. More... | |
static eDirection | RotateDirectionCW (eDirection a_Direction) |
Returns the direction corresponding to the given direction rotated 90 degrees CW around the Y axis. More... | |
static bool | StringToDirection (const AString &a_Value, eDirection &a_Out) |
Converts the string representation of a direction into the eDirection enum value. More... | |
Public Attributes | |
eDirection | m_Direction |
Direction in which the connector is facing. More... | |
Vector3i | m_Pos |
Position relative to the piece. More... | |
int | m_Type |
Type of the connector. More... | |
Definition at line 26 of file PiecePool.h.
Enumerator | |
---|---|
dirXM | |
dirXP | |
dirYM | |
dirYP | |
dirZM | |
dirZP | |
dirYM_XM_ZM | |
dirYM_XM_ZP | |
dirYM_XP_ZM | |
dirYM_XP_ZP | |
dirYP_XM_ZM | |
dirYP_XM_ZP | |
dirYP_XP_ZM | |
dirYP_XP_ZP |
Definition at line 28 of file PiecePool.h.
cPiece::cConnector::cConnector | ( | int | a_X, |
int | a_Y, | ||
int | a_Z, | ||
int | a_Type, | ||
eDirection | a_Direction | ||
) |
Definition at line 186 of file PiecePool.cpp.
cPiece::cConnector::cConnector | ( | const Vector3i & | a_Pos, |
int | a_Type, | ||
eDirection | a_Direction | ||
) |
Definition at line 197 of file PiecePool.cpp.
|
static |
Returns the position of the block that has the specified direction from the specified position.
Similar to AddFaceDirection()
Definition at line 208 of file PiecePool.cpp.
|
static |
Returns the string representation of the direction.
For debugging purposes.
Definition at line 234 of file PiecePool.cpp.
|
static |
Returns the number of CCW rotations that a_RotatingDir requires in order to be the counter-direction of a_FixedDir.
Ie. if you have a connector with a_FixedDir and you're rotating a piece that has a connector with a_RotatingDir, how many CCW rotations it needs to make the connectors compatible. Returns -1 if it is impossible to fit the two directions.
Definition at line 370 of file PiecePool.cpp.
|
static |
Returns true if the specified number corresponds to a valid eDirection.
Definition at line 260 of file PiecePool.cpp.
|
static |
Returns the direction corresponding to the given direction rotated 180 degrees around the Y axis.
Definition at line 289 of file PiecePool.cpp.
|
static |
Returns the direction corresponding to the given direction rotated 90 degrees CCW around the Y axis.
Definition at line 316 of file PiecePool.cpp.
|
static |
Returns the direction corresponding to the given direction rotated 90 degrees CW around the Y axis.
Definition at line 343 of file PiecePool.cpp.
|
static |
Converts the string representation of a direction into the eDirection enum value.
Returns true if successful, false on failure. Accepts both numbers and string representations such as "x+" or "Y+X-Z+".
Definition at line 401 of file PiecePool.cpp.
eDirection cPiece::cConnector::m_Direction |
Direction in which the connector is facing.
Will be matched by the opposite direction for the connecting connector.
Definition at line 58 of file PiecePool.h.
Vector3i cPiece::cConnector::m_Pos |
Position relative to the piece.
Definition at line 50 of file PiecePool.h.
int cPiece::cConnector::m_Type |
Type of the connector.
Any arbitrary number; the generator connects only connectors of opposite (negative) types.
Definition at line 54 of file PiecePool.h.