2014-05-11 16:35:41 -04:00
|
|
|
|
|
|
|
// VillageGen.h
|
|
|
|
|
|
|
|
// Declares the cVillageGen class representing the village generator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "GridStructGen.h"
|
|
|
|
#include "PrefabPiecePool.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-20 09:37:41 -04:00
|
|
|
// fwd:
|
|
|
|
class cVillagePiecePool;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-13 12:38:06 -04:00
|
|
|
class cVillageGen:
|
2014-05-11 16:35:41 -04:00
|
|
|
public cGridStructGen
|
|
|
|
{
|
2020-04-13 12:38:06 -04:00
|
|
|
using Super = cGridStructGen;
|
|
|
|
|
2014-05-11 16:35:41 -04:00
|
|
|
public:
|
2020-04-13 12:38:06 -04:00
|
|
|
|
2015-06-20 09:37:41 -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,
|
2015-06-20 09:37:41 -04:00
|
|
|
const AStringVector & a_PrefabsToLoad
|
|
|
|
);
|
2014-05-11 16:35:41 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
class cVillage; // fwd: VillageGen.cpp
|
2017-07-20 07:19:18 -04:00
|
|
|
typedef std::vector<std::shared_ptr<cVillagePiecePool>> cVillagePiecePools;
|
2014-05-11 16:35:41 -04:00
|
|
|
|
2014-05-22 15:47:56 -04:00
|
|
|
/** The noise used for generating random numbers */
|
2017-05-20 02:16:28 -04:00
|
|
|
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 */
|
2014-05-14 18:14:06 -04:00
|
|
|
int m_MaxDepth;
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2015-05-09 03:25:09 -04:00
|
|
|
/** Maximum size, in X / Z blocks, of the village (radius from the origin) */
|
2014-05-12 16:43:59 -04:00
|
|
|
int m_MaxSize;
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2014-05-22 15:47:56 -04:00
|
|
|
/** Minimum density - percentage of allowed house connections. Range [0, 100] */
|
|
|
|
int m_MinDensity;
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2014-05-22 15:47:56 -04:00
|
|
|
/** Maximum density - percentage of allowed house connections. Range [0, 100] */
|
|
|
|
int m_MaxDensity;
|
2014-05-11 16:35:41 -04:00
|
|
|
|
|
|
|
/** The underlying biome generator that defines whether the village is created or not */
|
2014-10-19 08:01:59 -04:00
|
|
|
cBiomeGenPtr m_BiomeGen;
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2014-05-11 16:35:41 -04:00
|
|
|
/** The underlying height generator, used to position the prefabs crossing chunk borders */
|
2014-10-19 08:01:59 -04:00
|
|
|
cTerrainHeightGenPtr m_HeightGen;
|
2014-05-11 16:35:41 -04:00
|
|
|
|
2015-06-20 09:37:41 -04:00
|
|
|
/** All available prefab sets. Each village gets one of these chosen randomly. */
|
|
|
|
cVillagePiecePools m_Pools;
|
|
|
|
|
2014-05-11 16:35:41 -04:00
|
|
|
|
|
|
|
// cGridStructGen overrides:
|
2014-06-16 10:12:50 -04:00
|
|
|
virtual cStructurePtr CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override;
|
2014-05-11 16:35:41 -04:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|