Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <VillageGen.h>
Classes | |
class | cVillage |
Public Member Functions | |
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. More... | |
Public Member Functions inherited from cGridStructGen | |
cGridStructGen (int a_Seed) | |
Creates a new instance that has the generation parameters set to defaults. More... | |
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) | |
virtual void | GenFinish (cChunkDesc &a_ChunkDesc) override |
void | SetGeneratorParams (const AStringMap &a_GeneratorParams) |
Sets the generator params based on the dictionary passed in. More... | |
Public Member Functions inherited from cFinishGen | |
virtual | ~cFinishGen () |
Protected Types | |
typedef std::vector< std::shared_ptr< cVillagePiecePool > > | cVillagePiecePools |
Protected Member Functions | |
virtual cStructurePtr | CreateStructure (int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override |
Create a new structure at the specified gridpoint. More... | |
Protected Member Functions inherited from cGridStructGen | |
void | ClearCache (void) |
Clears everything from the cache. More... | |
void | GetStructuresForChunk (int a_ChunkX, int a_ChunkZ, cStructurePtrs &a_Structures) |
Returns all structures that may intersect the given chunk. More... | |
Protected Attributes | |
cBiomeGen & | m_BiomeGen |
The underlying biome generator that defines whether the village is created or not. More... | |
cTerrainHeightGen & | m_HeightGen |
The underlying height generator, used to position the prefabs crossing chunk borders. More... | |
int | m_MaxDensity |
Maximum density - percentage of allowed house connections. More... | |
int | m_MaxDepth |
Maximum depth of the generator tree. More... | |
int | m_MaxSize |
Maximum size, in X / Z blocks, of the village (radius from the origin) More... | |
int | m_MinDensity |
Minimum density - percentage of allowed house connections. More... | |
cVillagePiecePools | m_Pools |
All available prefab sets. More... | |
cNoise | m_RandNoise |
The noise used for generating random numbers. More... | |
Protected Attributes inherited from cGridStructGen | |
int | m_BaseSeed |
Base seed of the world for which the generator generates chunk. More... | |
cStructurePtrs | m_Cache |
Cache for the most recently generated structures, ordered by the recentness. More... | |
int | m_GridSizeX |
The size of each grid's cell in the X axis. More... | |
int | m_GridSizeZ |
The size of each grid's cell in the Z axis. More... | |
size_t | m_MaxCacheSize |
Maximum allowed sum of costs for items in the cache. More... | |
int | m_MaxOffsetX |
The maximum offset of the structure's origin from the grid midpoint, in X coord. More... | |
int | m_MaxOffsetZ |
The maximum offset of the structure's origin from the grid midpoint, in Z coord. More... | |
int | m_MaxStructureSizeX |
Maximum theoretical size of the structure in the X axis. More... | |
int | m_MaxStructureSizeZ |
Maximum theoretical size of the structure in the Z axis. More... | |
cNoise | m_Noise |
The noise used for generating grid offsets. More... | |
int | m_Seed |
Seed for generating grid offsets and also available for descendants. More... | |
Private Types | |
using | Super = cGridStructGen |
Additional Inherited Members | |
Public Types inherited from cGridStructGen | |
typedef std::shared_ptr< cStructure > | cStructurePtr |
typedef std::list< cStructurePtr > | cStructurePtrs |
Definition at line 26 of file VillageGen.h.
|
protected |
Definition at line 49 of file VillageGen.h.
|
private |
Definition at line 29 of file VillageGen.h.
cVillageGen::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 at line 332 of file VillageGen.cpp.
|
overrideprotectedvirtual |
Create a new structure at the specified gridpoint.
Implements cGridStructGen.
Definition at line 376 of file VillageGen.cpp.
|
protected |
The underlying biome generator that defines whether the village is created or not.
Definition at line 67 of file VillageGen.h.
|
protected |
The underlying height generator, used to position the prefabs crossing chunk borders.
Definition at line 70 of file VillageGen.h.
|
protected |
Maximum density - percentage of allowed house connections.
Range [0, 100]
Definition at line 64 of file VillageGen.h.
|
protected |
Maximum depth of the generator tree.
Definition at line 55 of file VillageGen.h.
|
protected |
Maximum size, in X / Z blocks, of the village (radius from the origin)
Definition at line 58 of file VillageGen.h.
|
protected |
Minimum density - percentage of allowed house connections.
Range [0, 100]
Definition at line 61 of file VillageGen.h.
|
protected |
All available prefab sets.
Each village gets one of these chosen randomly.
Definition at line 73 of file VillageGen.h.
|
protected |
The noise used for generating random numbers.
Definition at line 52 of file VillageGen.h.