summaryrefslogtreecommitdiffstats
path: root/src/Generating/Prefab.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-06-17 15:22:43 +0200
committerMattes D <github@xoft.cz>2015-06-18 23:32:43 +0200
commitae1668942059b68580c83adc43ee9fb06e1e13f2 (patch)
treee093e9e6667876f6c5e7a3fccec0bb619022b7dd /src/Generating/Prefab.h
parentLuaState: Added support for config-style usage. (diff)
downloadcuberite-ae1668942059b68580c83adc43ee9fb06e1e13f2.tar
cuberite-ae1668942059b68580c83adc43ee9fb06e1e13f2.tar.gz
cuberite-ae1668942059b68580c83adc43ee9fb06e1e13f2.tar.bz2
cuberite-ae1668942059b68580c83adc43ee9fb06e1e13f2.tar.lz
cuberite-ae1668942059b68580c83adc43ee9fb06e1e13f2.tar.xz
cuberite-ae1668942059b68580c83adc43ee9fb06e1e13f2.tar.zst
cuberite-ae1668942059b68580c83adc43ee9fb06e1e13f2.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/Prefab.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/Generating/Prefab.h b/src/Generating/Prefab.h
index eb905e78e..45af4b282 100644
--- a/src/Generating/Prefab.h
+++ b/src/Generating/Prefab.h
@@ -95,6 +95,13 @@ public:
/** Creates a prefab based on the given BlockArea and allowed rotations. */
cPrefab(const cBlockArea & a_Image, int a_AllowedRotations);
+ /** Creates a prefab based on the given BlockArea. Allowed rotations can be added later on using SetAllowedRotations(). */
+ cPrefab(const cBlockArea & a_Image);
+
+ /** Creates a prefab based on the specified block data, using the char-to-block map in a_BlockDefinitions.
+ Allowed rotations can be added later on using SetAllowedRotations(). */
+ cPrefab(const AString & a_BlockDefinitions, const AString & a_BlockData, int a_SizeX, int a_SizeY, int a_SizeZ);
+
/** Draws the prefab into the specified chunk, according to the placement stored in the PlacedPiece. */
void Draw(cChunkDesc & a_Dest, const cPlacedPiece * a_Placement) const;
@@ -124,6 +131,21 @@ public:
at the coords governed by the connectors. */
bool ShouldMoveToGround(void) const { return m_MoveToGround; }
+ /** Sets the m_AllowedRotations bitmask and fills the m_BlockArea[] with rotated versions of m_BlockArea[0]. */
+ void SetAllowedRotations(int a_AllowedRotations);
+
+ /** Parses the per-depth weight into m_DepthWeight member. */
+ void ParseDepthWeight(const char * a_DepthWeightDef);
+
+ /** Sets the merge strategy to be used when drawing the piece. */
+ void SetMergeStrategy(cBlockArea::eMergeStrategy a_MergeStrategy) { m_MergeStrategy = a_MergeStrategy; }
+
+ /** Sets the flag whether the prefab should be moved to ground level before being drawn. */
+ void SetMoveToGround(bool a_MoveToGround) { m_MoveToGround = a_MoveToGround; }
+
+ /** Sets the flag whether the lowest layer of the prefab should be repeated downwards until it hits a solid block. */
+ void SetExtendFloor(bool a_ShouldExtendFloor) { m_ShouldExtendFloor = a_ShouldExtendFloor; }
+
protected:
/** Packs complete definition of a single block, for per-letter assignment. */
struct sBlockTypeDef
@@ -201,9 +223,6 @@ protected:
/** Parses the connectors definition text into m_Connectors member. */
void ParseConnectors(const char * a_ConnectorsDef);
-
- /** Parses the per-depth weight into m_DepthWeight member. */
- void ParseDepthWeight(const char * a_DepthWeightDef);
};