2015-11-11 04:32:42 -05:00
|
|
|
|
|
|
|
// PrefabStructure.h
|
|
|
|
|
|
|
|
// Declares the cPrefabStructure class representing a cGridStructGen::cStructure descendant based on placed cPrefab instances
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "GridStructGen.h"
|
2017-02-26 16:49:23 -05:00
|
|
|
#include "PiecePool.h"
|
2015-11-11 04:32:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cPrefabStructure:
|
|
|
|
public cGridStructGen::cStructure
|
|
|
|
{
|
2020-04-13 12:38:06 -04:00
|
|
|
using Super = cGridStructGen::cStructure;
|
2015-11-11 04:32:42 -05:00
|
|
|
|
|
|
|
public:
|
2020-04-13 12:38:06 -04:00
|
|
|
|
2015-11-11 04:32:42 -05:00
|
|
|
cPrefabStructure(
|
|
|
|
int a_GridX, int a_GridZ,
|
|
|
|
int a_OriginX, int a_OriginZ,
|
2017-02-26 16:49:23 -05:00
|
|
|
cPlacedPieces && a_Pieces,
|
2015-11-11 04:32:42 -05:00
|
|
|
cTerrainHeightGenPtr a_HeightGen
|
|
|
|
);
|
|
|
|
|
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|