diff options
author | madmaxoft <github@xoft.cz> | 2014-03-09 22:04:29 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-03-09 22:04:29 +0100 |
commit | 0e985293b50ec89a163f40222825b3c147135b9a (patch) | |
tree | 6a94d8e56f0db696246fdee73673f963c82aa5db /src/Generating/PieceGenerator.h | |
parent | Hardened cCuboid with asserts for its assumptions. (diff) | |
download | cuberite-0e985293b50ec89a163f40222825b3c147135b9a.tar cuberite-0e985293b50ec89a163f40222825b3c147135b9a.tar.gz cuberite-0e985293b50ec89a163f40222825b3c147135b9a.tar.bz2 cuberite-0e985293b50ec89a163f40222825b3c147135b9a.tar.lz cuberite-0e985293b50ec89a163f40222825b3c147135b9a.tar.xz cuberite-0e985293b50ec89a163f40222825b3c147135b9a.tar.zst cuberite-0e985293b50ec89a163f40222825b3c147135b9a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Generating/PieceGenerator.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Generating/PieceGenerator.h b/src/Generating/PieceGenerator.h index 310c21fdd..9dd5bcfba 100644 --- a/src/Generating/PieceGenerator.h +++ b/src/Generating/PieceGenerator.h @@ -30,6 +30,9 @@ Each uses a slightly different approach to generating: class cPiece { public: + // Force a virtual destructor in all descendants + virtual ~cPiece() {} + struct cConnector { /** Position relative to the piece */ @@ -82,9 +85,14 @@ typedef std::vector<cPiece *> cPieces; +/** This class is an interface that provides pieces for the generator. It can keep track of what pieces were +placed and adjust the returned piece vectors. */ class cPiecePool { public: + // Force a virtual destructor in all descendants: + virtual ~cPiecePool() {} + /** Returns a list of pieces that contain the specified connector type. The cPiece pointers returned are managed by the pool and the caller doesn't free them. */ virtual cPieces GetPiecesWithConnector(int a_ConnectorType) = 0; @@ -140,7 +148,7 @@ public: /** Cleans up all the memory used by the placed pieces. Call this utility function instead of freeing the items on your own. */ - void FreePieces(cPlacedPieces & a_PlacedPieces); + static void FreePieces(cPlacedPieces & a_PlacedPieces); protected: /** The type used for storing a connection from one piece to another, while building the piece tree. */ |