summaryrefslogtreecommitdiffstats
path: root/src/Generating/NetherFortGen.h
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-07-29 22:04:00 +0200
committerarchshift <admin@archshift.com>2014-07-29 22:04:00 +0200
commita9b597087b56b4526a3f6447789ba141568575a1 (patch)
treea08542d77b5668a25ca5e00492577ed6f4d61a9a /src/Generating/NetherFortGen.h
parentSpacing fixes and a few more BLOCK_META constants. (diff)
parentSlight cleanup after portals (diff)
downloadcuberite-a9b597087b56b4526a3f6447789ba141568575a1.tar
cuberite-a9b597087b56b4526a3f6447789ba141568575a1.tar.gz
cuberite-a9b597087b56b4526a3f6447789ba141568575a1.tar.bz2
cuberite-a9b597087b56b4526a3f6447789ba141568575a1.tar.lz
cuberite-a9b597087b56b4526a3f6447789ba141568575a1.tar.xz
cuberite-a9b597087b56b4526a3f6447789ba141568575a1.tar.zst
cuberite-a9b597087b56b4526a3f6447789ba141568575a1.zip
Diffstat (limited to 'src/Generating/NetherFortGen.h')
-rw-r--r--src/Generating/NetherFortGen.h63
1 files changed, 10 insertions, 53 deletions
diff --git a/src/Generating/NetherFortGen.h b/src/Generating/NetherFortGen.h
index d51596b9e..9b31aa0e2 100644
--- a/src/Generating/NetherFortGen.h
+++ b/src/Generating/NetherFortGen.h
@@ -10,77 +10,34 @@
#pragma once
#include "ComposableGenerator.h"
-#include "PieceGenerator.h"
+#include "PrefabPiecePool.h"
+#include "GridStructGen.h"
class cNetherFortGen :
- public cFinishGen,
- public cPiecePool
+ public cGridStructGen
{
-public:
- cNetherFortGen(int a_Seed, int a_GridSize, int a_MaxDepth);
+ typedef cGridStructGen super;
- virtual ~cNetherFortGen();
+public:
+ cNetherFortGen(int a_Seed, int a_GridSize, int a_MaxOffset, int a_MaxDepth);
protected:
friend class cNetherFortPerfTest; // fwd: NetherFortGen.cpp
class cNetherFort; // fwd: NetherFortGen.cpp
- typedef std::list<cNetherFort *> cNetherForts;
-
-
- /** The seed used for generating*/
- int m_Seed;
-
- /** The noise used for generating */
- cNoise m_Noise;
-
- /** Average spacing between the fortresses*/
- int m_GridSize;
/** Maximum depth of the piece-generator tree */
int m_MaxDepth;
-
- /** Cache of the most recently used systems. MoveToFront used. */
- cNetherForts m_Cache;
- /** All the pieces that are allowed for building.
- This is the list that's used for memory allocation and deallocation for the pieces. */
- cPieces m_AllPieces;
+ /** The pool of pieces to use for generating. Static, so that it's shared by multiple generators. */
+ static cPrefabPiecePool m_PiecePool;
- /** The pieces that are used as starting pieces.
- This list is not shared and the pieces need deallocation. */
- cPieces m_StartingPieces;
-
- /** The pieces that have an "outer" connector.
- The pieces are copies out of m_AllPieces and shouldn't be ever delete-d. */
- cPieces m_OuterPieces;
-
- /** The pieces that have an "inner" connector.
- The pieces are copies out of m_AllPieces and shouldn't be ever delete-d. */
- cPieces m_InnerPieces;
-
- /** Clears everything from the cache.
- Also invalidates the forst returned by GetFortsForChunk(). */
- void ClearCache(void);
-
- /** Returns all forts that *may* intersect the given chunk.
- The returned forts live within m_Cache.They are valid until the next call
- to this function (which may delete some of the pointers). */
- void GetFortsForChunk(int a_ChunkX, int a_ChunkZ, cNetherForts & a_Forts);
-
- // cFinishGen overrides:
- virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
-
- // cPiecePool overrides:
- virtual cPieces GetPiecesWithConnector(int a_ConnectorType) override;
- virtual cPieces GetStartingPieces(void) override;
- virtual int GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cConnector & a_ExistingConnector, const cPiece & a_NewPiece) override;
- virtual void PiecePlaced(const cPiece & a_Piece) override;
- virtual void Reset(void) override;
+ // cGridStructGen overrides:
+ virtual cStructurePtr CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override;
} ;