1
0
Fork 0
cuberite-2a/src/Generating/VillageGen.h

79 lines
1.7 KiB
C
Raw Normal View History

// VillageGen.h
// Declares the cVillageGen class representing the village generator
#pragma once
#include "GridStructGen.h"
#include "PrefabPiecePool.h"
// fwd:
class cVillagePiecePool;
2020-04-13 16:38:06 +00:00
class cVillageGen:
public cGridStructGen
{
2020-04-13 16:38:06 +00:00
using Super = cGridStructGen;
public:
2020-04-13 16:38:06 +00:00
/** Creates a new instance of the generator with the specified parameters. */
cVillageGen(
int a_Seed,
int a_GridSize,
int a_MaxOffset,
int a_MaxDepth,
int a_MaxSize,
int a_MinDensity, int a_MaxDensity,
2021-03-08 16:39:43 +00:00
cBiomeGen & a_BiomeGen,
cTerrainHeightGen & a_HeightGen,
2015-11-11 09:32:42 +00:00
int a_SeaLevel,
const AStringVector & a_PrefabsToLoad
);
protected:
class cVillage; // fwd: VillageGen.cpp
2017-07-20 11:19:18 +00:00
typedef std::vector<std::shared_ptr<cVillagePiecePool>> cVillagePiecePools;
/** The noise used for generating random numbers */
cNoise m_RandNoise;
2016-02-05 21:45:45 +00:00
2015-07-31 14:49:10 +00:00
/** Maximum depth of the generator tree */
int m_MaxDepth;
2016-02-05 21:45:45 +00:00
/** Maximum size, in X / Z blocks, of the village (radius from the origin) */
int m_MaxSize;
2016-02-05 21:45:45 +00:00
/** Minimum density - percentage of allowed house connections. Range [0, 100] */
int m_MinDensity;
2016-02-05 21:45:45 +00:00
/** Maximum density - percentage of allowed house connections. Range [0, 100] */
int m_MaxDensity;
/** The underlying biome generator that defines whether the village is created or not */
2021-03-08 16:39:43 +00:00
cBiomeGen & m_BiomeGen;
2016-02-05 21:45:45 +00:00
/** The underlying height generator, used to position the prefabs crossing chunk borders */
2021-03-08 16:39:43 +00:00
cTerrainHeightGen & m_HeightGen;
/** All available prefab sets. Each village gets one of these chosen randomly. */
cVillagePiecePools m_Pools;
// cGridStructGen overrides:
virtual cStructurePtr CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override;
} ;