Cuberite
A lightweight, fast and extensible game server for Minecraft
VillageGen.h
Go to the documentation of this file.
1 
2 // VillageGen.h
3 
4 // Declares the cVillageGen class representing the village generator
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "GridStructGen.h"
13 #include "PrefabPiecePool.h"
14 
15 
16 
17 
18 
19 // fwd:
20 class cVillagePiecePool;
21 
22 
23 
24 
25 
27  public cGridStructGen
28 {
30 
31 public:
32 
35  int a_Seed,
36  int a_GridSize,
37  int a_MaxOffset,
38  int a_MaxDepth,
39  int a_MaxSize,
40  int a_MinDensity, int a_MaxDensity,
41  cBiomeGen & a_BiomeGen,
42  cTerrainHeightGen & a_HeightGen,
43  int a_SeaLevel,
44  const AStringVector & a_PrefabsToLoad
45  );
46 
47 protected:
48  class cVillage; // fwd: VillageGen.cpp
49  typedef std::vector<std::shared_ptr<cVillagePiecePool>> cVillagePiecePools;
50 
53 
56 
58  int m_MaxSize;
59 
62 
65 
68 
71 
74 
75 
76  // cGridStructGen overrides:
77  virtual cStructurePtr CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override;
78 } ;
std::vector< AString > AStringVector
Definition: StringUtils.h:12
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.
Generates structures in a semi-random grid.
Definition: GridStructGen.h:46
std::shared_ptr< cStructure > cStructurePtr
Definition: GridStructGen.h:77
cGridStructGen(int a_Seed, int a_GridSizeX, int a_GridSizeZ, int a_MaxOffsetX, int a_MaxOffsetZ, int a_MaxStructureSizeX, int a_MaxStructureSizeZ, size_t a_MaxCacheSize)
int m_MaxDensity
Maximum density - percentage of allowed house connections.
Definition: VillageGen.h:64
cVillagePiecePools m_Pools
All available prefab sets.
Definition: VillageGen.h:73
cVillageGen(int a_Seed, int a_GridSize, int a_MaxOffset, int a_MaxDepth, int a_MaxSize, int a_MinDensity, int a_MaxDensity, cBiomeGen &a_BiomeGen, cTerrainHeightGen &a_HeightGen, int a_SeaLevel, const AStringVector &a_PrefabsToLoad)
Creates a new instance of the generator with the specified parameters.
Definition: VillageGen.cpp:332
int m_MaxDepth
Maximum depth of the generator tree.
Definition: VillageGen.h:55
cTerrainHeightGen & m_HeightGen
The underlying height generator, used to position the prefabs crossing chunk borders.
Definition: VillageGen.h:70
cBiomeGen & m_BiomeGen
The underlying biome generator that defines whether the village is created or not.
Definition: VillageGen.h:67
virtual cStructurePtr CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override
Create a new structure at the specified gridpoint.
Definition: VillageGen.cpp:376
cNoise m_RandNoise
The noise used for generating random numbers.
Definition: VillageGen.h:52
int m_MaxSize
Maximum size, in X / Z blocks, of the village (radius from the origin)
Definition: VillageGen.h:58
std::vector< std::shared_ptr< cVillagePiecePool > > cVillagePiecePools
Definition: VillageGen.h:48
int m_MinDensity
Minimum density - percentage of allowed house connections.
Definition: VillageGen.h:61
Definition: Noise.h:20