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

Represents a single piece that has been placed to specific coords in the world. More...

#include <PiecePool.h>

Collaboration diagram for cPlacedPiece:
Collaboration graph
[legend]

Public Member Functions

 cPlacedPiece (const cPlacedPiece *a_Parent, const cPiece &a_Piece, const Vector3i &a_Coords, int a_NumCCWRotations)
 
Vector3iGetCoords (void)
 Returns the coords as a modifiable object. More...
 
const Vector3iGetCoords (void) const
 
int GetDepth (void) const
 
const cCuboidGetHitBox (void) const
 
int GetNumCCWRotations (void) const
 
const cPlacedPieceGetParent (void) const
 
const cPieceGetPiece (void) const
 
cPiece::cConnector GetRotatedConnector (const cPiece::cConnector &a_Connector) const
 Returns a copy of the specified connector, modified to account for the translation and rotation for this placement. More...
 
cPiece::cConnector GetRotatedConnector (size_t a_Index) const
 Returns the connector at the specified index, rotated in the actual placement. More...
 
bool HasBeenMovedToGround (void) const
 
void MoveToGroundBy (int a_OffsetY)
 Moves the placed piece Y-wise by the specified offset. More...
 

Protected Attributes

Vector3i m_Coords
 
int m_Depth
 
bool m_HasBeenMovedToGround
 Set to true once the piece has been moved Y-wise. More...
 
cCuboid m_HitBox
 
int m_NumCCWRotations
 
const cPlacedPiecem_Parent
 
const cPiecem_Piece
 

Detailed Description

Represents a single piece that has been placed to specific coords in the world.

Definition at line 327 of file PiecePool.h.

Constructor & Destructor Documentation

◆ cPlacedPiece()

cPlacedPiece::cPlacedPiece ( const cPlacedPiece a_Parent,
const cPiece a_Piece,
const Vector3i a_Coords,
int  a_NumCCWRotations 
)

Definition at line 468 of file PiecePool.cpp.

Member Function Documentation

◆ GetCoords() [1/2]

Vector3i& cPlacedPiece::GetCoords ( void  )
inline

Returns the coords as a modifiable object.

Definition at line 341 of file PiecePool.h.

◆ GetCoords() [2/2]

const Vector3i& cPlacedPiece::GetCoords ( void  ) const
inline

Definition at line 334 of file PiecePool.h.

◆ GetDepth()

int cPlacedPiece::GetDepth ( void  ) const
inline

Definition at line 337 of file PiecePool.h.

◆ GetHitBox()

const cCuboid& cPlacedPiece::GetHitBox ( void  ) const
inline

Definition at line 336 of file PiecePool.h.

◆ GetNumCCWRotations()

int cPlacedPiece::GetNumCCWRotations ( void  ) const
inline

Definition at line 335 of file PiecePool.h.

◆ GetParent()

const cPlacedPiece* cPlacedPiece::GetParent ( void  ) const
inline

Definition at line 332 of file PiecePool.h.

◆ GetPiece()

const cPiece& cPlacedPiece::GetPiece ( void  ) const
inline

Definition at line 333 of file PiecePool.h.

◆ GetRotatedConnector() [1/2]

cPiece::cConnector cPlacedPiece::GetRotatedConnector ( const cPiece::cConnector a_Connector) const

Returns a copy of the specified connector, modified to account for the translation and rotation for this placement.

Definition at line 495 of file PiecePool.cpp.

◆ GetRotatedConnector() [2/2]

cPiece::cConnector cPlacedPiece::GetRotatedConnector ( size_t  a_Index) const

Returns the connector at the specified index, rotated in the actual placement.

Undefined behavior if a_Index is out of range.

Definition at line 484 of file PiecePool.cpp.

◆ HasBeenMovedToGround()

bool cPlacedPiece::HasBeenMovedToGround ( void  ) const
inline

Definition at line 338 of file PiecePool.h.

◆ MoveToGroundBy()

void cPlacedPiece::MoveToGroundBy ( int  a_OffsetY)

Moves the placed piece Y-wise by the specified offset.

Sets m_HasBeenMovedToGround to true, too. Used eg. by village houses.

Definition at line 504 of file PiecePool.cpp.

Member Data Documentation

◆ m_Coords

Vector3i cPlacedPiece::m_Coords
protected

Definition at line 359 of file PiecePool.h.

◆ m_Depth

int cPlacedPiece::m_Depth
protected

Definition at line 362 of file PiecePool.h.

◆ m_HasBeenMovedToGround

bool cPlacedPiece::m_HasBeenMovedToGround
protected

Set to true once the piece has been moved Y-wise.

Used eg. by village houses.

Definition at line 366 of file PiecePool.h.

◆ m_HitBox

cCuboid cPlacedPiece::m_HitBox
protected

Definition at line 361 of file PiecePool.h.

◆ m_NumCCWRotations

int cPlacedPiece::m_NumCCWRotations
protected

Definition at line 360 of file PiecePool.h.

◆ m_Parent

const cPlacedPiece* cPlacedPiece::m_Parent
protected

Definition at line 357 of file PiecePool.h.

◆ m_Piece

const cPiece* cPlacedPiece::m_Piece
protected

Definition at line 358 of file PiecePool.h.


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