Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | List of all members
cPrefabStructure Class Reference

#include <PrefabStructure.h>

Inheritance diagram for cPrefabStructure:
Inheritance graph
[legend]
Collaboration diagram for cPrefabStructure:
Collaboration graph
[legend]

Public Member Functions

 cPrefabStructure (int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ, cPlacedPieces &&a_Pieces, cTerrainHeightGen &a_HeightGen)
 
- Public Member Functions inherited from cGridStructGen::cStructure
 cStructure (int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ)
 Creates a structure that has its origin set at the specified coords. More...
 
virtual size_t GetCacheCost (void) const
 Returns the cost of keeping this structure in the cache. More...
 
virtual ~cStructure ()
 

Protected Member Functions

virtual void DrawIntoChunk (cChunkDesc &a_Chunk) override
 Draws self into the specified chunk. More...
 
void PlacePieceOnGround (cPlacedPiece &a_Piece)
 Adjusts the Y coord of the given piece so that the piece is on the ground. More...
 

Protected Attributes

cTerrainHeightGenm_HeightGen
 The height generator used when adjusting pieces onto the ground. More...
 
cPlacedPieces m_Pieces
 The pieces placed by the generator. More...
 

Private Types

using Super = cGridStructGen::cStructure
 

Additional Inherited Members

- Public Attributes inherited from cGridStructGen::cStructure
int m_GridX
 The grid point for which the structure is generated. More...
 
int m_GridZ
 
int m_OriginX
 The origin (the coords for which the structure is generated) More...
 
int m_OriginZ
 

Detailed Description

Definition at line 19 of file PrefabStructure.h.

Member Typedef Documentation

◆ Super

Definition at line 22 of file PrefabStructure.h.

Constructor & Destructor Documentation

◆ cPrefabStructure()

cPrefabStructure::cPrefabStructure ( int  a_GridX,
int  a_GridZ,
int  a_OriginX,
int  a_OriginZ,
cPlacedPieces &&  a_Pieces,
cTerrainHeightGen a_HeightGen 
)

Definition at line 14 of file PrefabStructure.cpp.

Member Function Documentation

◆ DrawIntoChunk()

void cPrefabStructure::DrawIntoChunk ( cChunkDesc a_ChunkDesc)
overrideprotectedvirtual

Draws self into the specified chunk.

Implements cGridStructGen::cStructure.

Definition at line 30 of file PrefabStructure.cpp.

◆ PlacePieceOnGround()

void cPrefabStructure::PlacePieceOnGround ( cPlacedPiece a_Piece)
protected

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.

Definition at line 49 of file PrefabStructure.cpp.

Member Data Documentation

◆ m_HeightGen

cTerrainHeightGen& cPrefabStructure::m_HeightGen
protected

The height generator used when adjusting pieces onto the ground.

Definition at line 38 of file PrefabStructure.h.

◆ m_Pieces

cPlacedPieces cPrefabStructure::m_Pieces
protected

The pieces placed by the generator.

Definition at line 35 of file PrefabStructure.h.


The documentation for this class was generated from the following files: