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

83 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 12:38:06 -04:00
class cVillageGen:
public cGridStructGen
{
2020-04-13 12:38:06 -04:00
using Super = cGridStructGen;
public:
2020-04-13 12:38:06 -04: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,
cBiomeGenPtr a_BiomeGen,
cTerrainHeightGenPtr a_HeightGen,
2015-11-11 04:32:42 -05:00
int a_SeaLevel,
const AStringVector & a_PrefabsToLoad
);
protected:
class cVillage; // fwd: VillageGen.cpp
2017-07-20 07:19:18 -04:00
typedef std::vector<std::shared_ptr<cVillagePiecePool>> cVillagePiecePools;
/** The noise used for generating random numbers */
cNoise m_RandNoise;
2016-02-05 16:45:45 -05:00
2015-07-31 10:49:10 -04:00
/** Maximum depth of the generator tree */
int m_MaxDepth;
2016-02-05 16:45:45 -05:00
/** Maximum size, in X / Z blocks, of the village (radius from the origin) */
int m_MaxSize;
2016-02-05 16:45:45 -05:00
/** Minimum density - percentage of allowed house connections. Range [0, 100] */
int m_MinDensity;
2016-02-05 16:45:45 -05: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 */
cBiomeGenPtr m_BiomeGen;
2016-02-05 16:45:45 -05:00
/** The underlying height generator, used to position the prefabs crossing chunk borders */
cTerrainHeightGenPtr 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;
} ;