summaryrefslogtreecommitdiffstats
path: root/src/Generating/PieceGenerator.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-05-25 23:50:16 +0200
committermadmaxoft <github@xoft.cz>2014-05-25 23:50:16 +0200
commit1a742a2b52d32bd22cd57b4d462bee312717e010 (patch)
tree65657eb46ac05e24b101a14f45a9d124212322cd /src/Generating/PieceGenerator.h
parentAdded Japanese village prefabs. (diff)
downloadcuberite-1a742a2b52d32bd22cd57b4d462bee312717e010.tar
cuberite-1a742a2b52d32bd22cd57b4d462bee312717e010.tar.gz
cuberite-1a742a2b52d32bd22cd57b4d462bee312717e010.tar.bz2
cuberite-1a742a2b52d32bd22cd57b4d462bee312717e010.tar.lz
cuberite-1a742a2b52d32bd22cd57b4d462bee312717e010.tar.xz
cuberite-1a742a2b52d32bd22cd57b4d462bee312717e010.tar.zst
cuberite-1a742a2b52d32bd22cd57b4d462bee312717e010.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/PieceGenerator.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/Generating/PieceGenerator.h b/src/Generating/PieceGenerator.h
index e396643a9..21c155c96 100644
--- a/src/Generating/PieceGenerator.h
+++ b/src/Generating/PieceGenerator.h
@@ -139,11 +139,13 @@ class cPlacedPiece
public:
cPlacedPiece(const cPlacedPiece * a_Parent, const cPiece & a_Piece, const Vector3i & a_Coords, int a_NumCCWRotations);
- const cPiece & GetPiece (void) const { return *m_Piece; }
- const Vector3i & GetCoords (void) const { return m_Coords; }
- int GetNumCCWRotations(void) const { return m_NumCCWRotations; }
- const cCuboid & GetHitBox (void) const { return m_HitBox; }
- int GetDepth (void) const { return m_Depth; }
+ const cPlacedPiece * GetParent (void) const { return m_Parent; }
+ const cPiece & GetPiece (void) const { return *m_Piece; }
+ const Vector3i & GetCoords (void) const { return m_Coords; }
+ int GetNumCCWRotations (void) const { return m_NumCCWRotations; }
+ const cCuboid & GetHitBox (void) const { return m_HitBox; }
+ int GetDepth (void) const { return m_Depth; }
+ bool HasBeenMovedToGround(void) const { return m_HasBeenMovedToGround; }
/** Returns the coords as a modifiable object. */
Vector3i & GetCoords(void) { return m_Coords; }
@@ -156,6 +158,11 @@ public:
this placement. */
cPiece::cConnector GetRotatedConnector(const cPiece::cConnector & a_Connector) const;
+ /** Moves the placed piece Y-wise by the specified offset.
+ Sets m_HasBeenMovedToGround to true, too.
+ Used eg. by village houses. */
+ void MoveToGroundBy(int a_OffsetY);
+
protected:
const cPlacedPiece * m_Parent;
const cPiece * m_Piece;
@@ -163,6 +170,10 @@ protected:
int m_NumCCWRotations;
cCuboid m_HitBox; // Hitbox of the placed piece, in world coords
int m_Depth; // Depth in the generated piece tree
+
+ /** Set to true once the piece has been moved Y-wise.
+ Used eg. by village houses. */
+ bool m_HasBeenMovedToGround;
};
typedef std::vector<cPlacedPiece *> cPlacedPieces;