Cuberite
A lightweight, fast and extensible game server for Minecraft
PrefabStructure.h
Go to the documentation of this file.
1 
2 // PrefabStructure.h
3 
4 // Declares the cPrefabStructure class representing a cGridStructGen::cStructure descendant based on placed cPrefab instances
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "GridStructGen.h"
13 #include "PiecePool.h"
14 
15 
16 
17 
18 
21 {
23 
24 public:
25 
27  int a_GridX, int a_GridZ,
28  int a_OriginX, int a_OriginZ,
29  cPlacedPieces && a_Pieces,
30  cTerrainHeightGen & a_HeightGen
31  );
32 
33 protected:
36 
39 
40 
41  // cGridStructGen::cStructure overrides:
42  virtual void DrawIntoChunk(cChunkDesc & a_Chunk) override;
43 
46  void PlacePieceOnGround(cPlacedPiece & a_Piece);
47 };
std::vector< cPlacedPiecePtr > cPlacedPieces
Definition: PiecePool.h:370
The interface that is used to query terrain height from the shape generator.
Represents a single structure that occupies the grid point.
Definition: GridStructGen.h:50
Represents a single piece that has been placed to specific coords in the world.
Definition: PiecePool.h:328
void PlacePieceOnGround(cPlacedPiece &a_Piece)
Adjusts the Y coord of the given piece so that the piece is on the ground.
virtual void DrawIntoChunk(cChunkDesc &a_Chunk) override
Draws self into the specified chunk.
cPlacedPieces m_Pieces
The pieces placed by the generator.
cPrefabStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ, cPlacedPieces &&a_Pieces, cTerrainHeightGen &a_HeightGen)
cTerrainHeightGen & m_HeightGen
The height generator used when adjusting pieces onto the ground.