summaryrefslogtreecommitdiffstats
path: root/src/Generating/PieceGenerator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Generating/PieceGenerator.h')
-rw-r--r--src/Generating/PieceGenerator.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Generating/PieceGenerator.h b/src/Generating/PieceGenerator.h
index 16bec3bb4..e396643a9 100644
--- a/src/Generating/PieceGenerator.h
+++ b/src/Generating/PieceGenerator.h
@@ -110,6 +110,7 @@ public:
virtual cPieces GetStartingPieces(void) = 0;
/** Returns the relative weight with which the a_NewPiece is to be selected for placing under a_PlacedPiece through a_ExistingConnector.
+ a_ExistingConnector is the original connector, before any movement or rotation is applied to it.
This allows the pool to tweak the piece's chances, based on the previous pieces in the tree and the connector used.
The higher the number returned, the higher the chance the piece will be chosen. 0 means the piece will never be chosen.
*/
@@ -144,13 +145,24 @@ public:
const cCuboid & GetHitBox (void) const { return m_HitBox; }
int GetDepth (void) const { return m_Depth; }
+ /** Returns the coords as a modifiable object. */
+ Vector3i & GetCoords(void) { return m_Coords; }
+
+ /** Returns the connector at the specified index, rotated in the actual placement.
+ Undefined behavior if a_Index is out of range. */
+ cPiece::cConnector GetRotatedConnector(size_t a_Index) const;
+
+ /** Returns a copy of the specified connector, modified to account for the translation and rotation for
+ this placement. */
+ cPiece::cConnector GetRotatedConnector(const cPiece::cConnector & a_Connector) const;
+
protected:
const cPlacedPiece * m_Parent;
const cPiece * m_Piece;
Vector3i m_Coords;
int m_NumCCWRotations;
- cCuboid m_HitBox;
- int m_Depth;
+ cCuboid m_HitBox; // Hitbox of the placed piece, in world coords
+ int m_Depth; // Depth in the generated piece tree
};
typedef std::vector<cPlacedPiece *> cPlacedPieces;