Cuberite
A lightweight, fast and extensible game server for Minecraft
Caves.h
Go to the documentation of this file.
1 
2 // Caves.h
3 
4 // Interfaces to the various cave structure generators:
5 // - cStructGenWormNestCaves
6 // - cStructGenMarbleCaves
7 // - cStructGenNetherCaves
8 
9 
10 
11 
12 
13 #pragma once
14 
15 #include "GridStructGen.h"
16 
17 
18 
19 
20 
22  public cFinishGen
23 {
24 public:
25  cStructGenMarbleCaves(int a_Seed) : m_Seed(a_Seed) {}
26 
27 protected:
28 
29  int m_Seed;
30 
31  // cFinishGen override:
32  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
33 } ;
34 
35 
36 
37 
38 
40  public cFinishGen
41 {
42 public:
43  cStructGenDualRidgeCaves(int a_Seed, float a_Threshold) :
44  m_Noise1(a_Seed),
45  m_Noise2(2 * a_Seed + 19999),
46  m_Seed(a_Seed),
47  m_Threshold(a_Threshold)
48  {
49  }
50 
51 protected:
54  int m_Seed;
55  float m_Threshold;
56 
57  // cFinishGen override:
58  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
59 } ;
60 
61 
62 
63 
64 
66  public cGridStructGen
67 {
69 
70 public:
71 
72  cStructGenWormNestCaves(int a_Seed, int a_Size = 64, int a_Grid = 96, int a_MaxOffset = 128) :
73  Super(a_Seed, a_Grid, a_Grid, a_MaxOffset, a_MaxOffset, a_Size, a_Size, 100),
74  m_Size(a_Size),
75  m_MaxOffset(a_MaxOffset),
76  m_Grid(a_Grid)
77  {
78  }
79 
80 protected:
81 
82  class cCaveSystem; // fwd: Caves.cpp
83 
84  int m_Size; // relative size of the cave systems' caves. Average number of blocks of each initial tunnel
85  int m_MaxOffset; // maximum offset of the cave nest origin from the grid cell the nest belongs to
86  int m_Grid; // average spacing of the nests
87 
88  // cGridStructGen override:
89  virtual cStructurePtr CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override;
90 } ;
91 
92 
93 
94 
cStructGenMarbleCaves(int a_Seed)
Definition: Caves.h:25
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: Caves.cpp:730
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: Caves.cpp:766
cStructGenDualRidgeCaves(int a_Seed, float a_Threshold)
Definition: Caves.h:43
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: Caves.cpp:696
cStructGenWormNestCaves(int a_Seed, int a_Size=64, int a_Grid=96, int a_MaxOffset=128)
Definition: Caves.h:72
The interface that a finisher must implement Finisher implements changes to the chunk after the rough...
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)
Definition: Noise.h:20