Cuberite
A lightweight, fast and extensible game server for Minecraft
SinglePieceStructuresGen.h
Go to the documentation of this file.
1 
2 // PrefabSingleStructureGen.h
3 
4 
5 /*
6 Classes to support the generation of single piece prefab structures
7 */
8 
9 #pragma once
10 
11 #include "Globals.h"
12 
13 #include "ComposableGenerator.h"
14 #include "PrefabPiecePool.h"
15 
22  public cFinishGen
23 {
24 using Super = cFinishGen;
25 
26 public:
27  cSinglePieceStructuresGen(int a_Seed);
28 
33  bool Initialize(const AString & a_Prefabs, int a_SeaLevel, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen);
34 
35 
36  // cFinishGen override:
37  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
38 
39 protected:
42  class cGen;
43 
44  typedef std::shared_ptr<cGen> cGenPtr;
45  typedef std::vector<cGenPtr> cGenPtrs;
46 
49 
51  int m_Seed;
52 };
std::string AString
Definition: StringUtils.h:11
The interface that a biome generator must implement A biome generator takes chunk coords on input and...
The interface that is used to query terrain height from the shape generator.
The interface that a finisher must implement Finisher implements changes to the chunk after the rough...
The Single Prefab Structure Generator: This uses the cGridStructGen to generate the structures on the...
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
std::shared_ptr< cGen > cGenPtr
bool Initialize(const AString &a_Prefabs, int a_SeaLevel, cBiomeGen &a_BiomeGen, cTerrainHeightGen &a_HeightGen)
Initializes the generator based on the specified prefab sets.
std::vector< cGenPtr > cGenPtrs
cGenPtrs m_Gens
The individual structure generators, one per piecepool.
int m_Seed
The seed for the random number generator.