Cuberite
A lightweight, fast and extensible game server for Minecraft
PieceStructuresGen.h
Go to the documentation of this file.
1 
2 // PieceStructuresGen.h
3 
4 // Declares the cPieceStructuresGen class representing the PieceStructures finisher generator
5 
6 /*
7 This generator loads various pieces from "piecepool" files, and each such piecepool is then used in a separate
8 cPieceGenerator instance.
9 */
10 
11 
12 
13 
14 
15 #pragma once
16 
17 #include "ComposableGenerator.h"
18 #include "PrefabPiecePool.h"
19 
20 
21 
22 
23 
25  public cFinishGen
26 {
27  using Super = cFinishGen;
28 
29 public:
30 
31  cPieceStructuresGen(int a_Seed);
32 
37  bool Initialize(const AString & a_Prefabs, int a_SeaLevel, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen);
38 
39  // cFinishGen override:
40  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
41 
42 protected:
45  class cGen;
46 
47  typedef std::shared_ptr<cGen> cGenPtr;
48  typedef std::vector<cGenPtr> cGenPtrs;
49 
50 
53 
55  int m_Seed;
56 };
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...
int m_Seed
The seed for the random number generator.
std::shared_ptr< cGen > cGenPtr
std::vector< cGenPtr > cGenPtrs
cGenPtrs m_Gens
The individual structure generators, one per piecepool.
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
bool Initialize(const AString &a_Prefabs, int a_SeaLevel, cBiomeGen &a_BiomeGen, cTerrainHeightGen &a_HeightGen)
Initializes the generator based on the specified prefab sets.