summaryrefslogtreecommitdiffstats
path: root/src/Generating/PrefabStructure.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-12-03 13:07:23 +0100
committerMattes D <github@xoft.cz>2015-12-03 13:07:23 +0100
commit3fb356648453169758a9f5649f0ed4c5925d911f (patch)
tree57c90ff51aaeac4b1c2e05538a9f486da0a19f28 /src/Generating/PrefabStructure.h
parentMerge pull request #2696 from Gargaj/breeding (diff)
parentChanged Nether defaults to use PieceStructures. (diff)
downloadcuberite-3fb356648453169758a9f5649f0ed4c5925d911f.tar
cuberite-3fb356648453169758a9f5649f0ed4c5925d911f.tar.gz
cuberite-3fb356648453169758a9f5649f0ed4c5925d911f.tar.bz2
cuberite-3fb356648453169758a9f5649f0ed4c5925d911f.tar.lz
cuberite-3fb356648453169758a9f5649f0ed4c5925d911f.tar.xz
cuberite-3fb356648453169758a9f5649f0ed4c5925d911f.tar.zst
cuberite-3fb356648453169758a9f5649f0ed4c5925d911f.zip
Diffstat (limited to 'src/Generating/PrefabStructure.h')
-rw-r--r--src/Generating/PrefabStructure.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/Generating/PrefabStructure.h b/src/Generating/PrefabStructure.h
new file mode 100644
index 000000000..29a506494
--- /dev/null
+++ b/src/Generating/PrefabStructure.h
@@ -0,0 +1,52 @@
+
+// PrefabStructure.h
+
+// Declares the cPrefabStructure class representing a cGridStructGen::cStructure descendant based on placed cPrefab instances
+
+
+
+
+
+#pragma once
+
+#include "GridStructGen.h"
+#include "PieceGenerator.h"
+
+
+
+
+
+class cPrefabStructure:
+ public cGridStructGen::cStructure
+{
+ typedef cGridStructGen::cStructure Super;
+
+public:
+ cPrefabStructure(
+ int a_GridX, int a_GridZ,
+ int a_OriginX, int a_OriginZ,
+ cPlacedPieces & a_Pieces,
+ cTerrainHeightGenPtr a_HeightGen
+ );
+
+ virtual ~cPrefabStructure();
+
+protected:
+ /** The pieces placed by the generator. */
+ cPlacedPieces m_Pieces;
+
+ /** The height generator used when adjusting pieces onto the ground. */
+ cTerrainHeightGenPtr m_HeightGen;
+
+
+ // cGridStructGen::cStructure overrides:
+ virtual void DrawIntoChunk(cChunkDesc & a_Chunk) override;
+
+ /** Adjusts the Y coord of the given piece so that the piece is on the ground.
+ Ground level is assumed to be represented by the first connector in the piece. */
+ void PlacePieceOnGround(cPlacedPiece & a_Piece);
+};
+
+
+
+