diff options
author | madmaxoft <github@xoft.cz> | 2014-05-15 00:12:01 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-05-15 00:12:01 +0200 |
commit | 3660ce68343ad2e867e49d1650f61fc0eb85ac23 (patch) | |
tree | 33d0c7b9994104f1eea432a91b53c35564afb3c5 /src/Generating/Prefab.h | |
parent | VillageGen: Added well placement and the general algorithm description. (diff) | |
download | cuberite-3660ce68343ad2e867e49d1650f61fc0eb85ac23.tar cuberite-3660ce68343ad2e867e49d1650f61fc0eb85ac23.tar.gz cuberite-3660ce68343ad2e867e49d1650f61fc0eb85ac23.tar.bz2 cuberite-3660ce68343ad2e867e49d1650f61fc0eb85ac23.tar.lz cuberite-3660ce68343ad2e867e49d1650f61fc0eb85ac23.tar.xz cuberite-3660ce68343ad2e867e49d1650f61fc0eb85ac23.tar.zst cuberite-3660ce68343ad2e867e49d1650f61fc0eb85ac23.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Generating/Prefab.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Generating/Prefab.h b/src/Generating/Prefab.h index 472584c3a..c08413e87 100644 --- a/src/Generating/Prefab.h +++ b/src/Generating/Prefab.h @@ -84,8 +84,13 @@ public: int m_AddWeightIfSame; }; + + /** Creates a prefab from the provided definition. */ cPrefab(const sDef & a_Def); + /** Creates a prefab based on the given BlockArea and allowed rotations. */ + cPrefab(const cBlockArea & a_Image, int a_AllowedRotations); + /** 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; @@ -98,6 +103,12 @@ public: /** Returns the unmodified DefaultWeight property for the piece. */ int GetDefaultWeight(void) const { return m_DefaultWeight; } + + /** Sets the AddWeightIfSame member, that is used to modify the weight when the previous piece is the same prefab */ + void SetAddWeightIfSame(int a_AddWeightIfSame) { m_AddWeightIfSame = a_AddWeightIfSame; } + + /** Adds the specified connector to the list of connectors this piece supports. */ + void AddConnector(int a_RelX, int a_RelY, int a_RelZ, eBlockFace a_Direction, int a_Type); protected: /** Packs complete definition of a single block, for per-letter assignment. */ @@ -160,6 +171,10 @@ protected: virtual cCuboid GetHitBox(void) const override; virtual bool CanRotateCCW(int a_NumRotations) const override; + /** Based on the m_AllowedRotations, adds rotated cBlockAreas to the m_BlockArea array. + To be called only from this class's constructor! */ + void AddRotatedBlockAreas(void); + /** Parses the CharMap in the definition into a CharMap binary data used for translating the definition into BlockArea. */ void ParseCharMap(CharMap & a_CharMapOut, const char * a_CharMapDef); |