1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Node definition manager refactor (#7016)

* Rename IWritableNodeDefManager to NodeDefManager
* Make INodeDefManager functions const
* Use "const *NodeDefManager" instead of "*INodeDefManager"
* Remove unused INodeDefManager class
* Merge NodeDefManager and CNodeDefManager
* Document NodeDefManager
This commit is contained in:
Dániel Juhász 2018-02-10 22:04:16 +02:00 committed by SmallJoker
parent 617d94c803
commit 3face01a20
61 changed files with 583 additions and 457 deletions

View file

@ -39,15 +39,15 @@ class GenerateNotifier;
class CavesNoiseIntersection
{
public:
CavesNoiseIntersection(INodeDefManager *nodedef, BiomeManager *biomemgr,
v3s16 chunksize, NoiseParams *np_cave1, NoiseParams *np_cave2,
s32 seed, float cave_width);
CavesNoiseIntersection(const NodeDefManager *nodedef,
BiomeManager *biomemgr, v3s16 chunksize, NoiseParams *np_cave1,
NoiseParams *np_cave2, s32 seed, float cave_width);
~CavesNoiseIntersection();
void generateCaves(MMVManip *vm, v3s16 nmin, v3s16 nmax, u8 *biomemap);
private:
INodeDefManager *m_ndef;
const NodeDefManager *m_ndef;
BiomeManager *m_bmgr;
// configurable parameters
@ -68,15 +68,15 @@ private:
class CavernsNoise
{
public:
CavernsNoise(INodeDefManager *nodedef, v3s16 chunksize, NoiseParams *np_cavern,
s32 seed, float cavern_limit, float cavern_taper,
float cavern_threshold);
CavernsNoise(const NodeDefManager *nodedef, v3s16 chunksize,
NoiseParams *np_cavern, s32 seed, float cavern_limit,
float cavern_taper, float cavern_threshold);
~CavernsNoise();
bool generateCaverns(MMVManip *vm, v3s16 nmin, v3s16 nmax);
private:
INodeDefManager *m_ndef;
const NodeDefManager *m_ndef;
// configurable parameters
v3s16 m_csize;
@ -111,7 +111,7 @@ class CavesRandomWalk
{
public:
MMVManip *vm;
INodeDefManager *ndef;
const NodeDefManager *ndef;
GenerateNotifier *gennotify;
s16 *heightmap;
@ -153,10 +153,10 @@ public:
// ndef is a mandatory parameter.
// If gennotify is NULL, generation events are not logged.
CavesRandomWalk(INodeDefManager *ndef, GenerateNotifier *gennotify = NULL,
s32 seed = 0, int water_level = 1,
content_t water_source = CONTENT_IGNORE,
content_t lava_source = CONTENT_IGNORE, int lava_depth = -256);
CavesRandomWalk(const NodeDefManager *ndef, GenerateNotifier *gennotify =
NULL, s32 seed = 0, int water_level = 1, content_t water_source =
CONTENT_IGNORE, content_t lava_source = CONTENT_IGNORE,
int lava_depth = -256);
// vm and ps are mandatory parameters.
// If heightmap is NULL, the surface level at all points is assumed to
@ -188,7 +188,7 @@ class CavesV6
{
public:
MMVManip *vm;
INodeDefManager *ndef;
const NodeDefManager *ndef;
GenerateNotifier *gennotify;
PseudoRandom *ps;
PseudoRandom *ps2;
@ -224,7 +224,7 @@ public:
// ndef is a mandatory parameter.
// If gennotify is NULL, generation events are not logged.
CavesV6(INodeDefManager *ndef, GenerateNotifier *gennotify = NULL,
CavesV6(const NodeDefManager *ndef, GenerateNotifier *gennotify = NULL,
int water_level = 1, content_t water_source = CONTENT_IGNORE,
content_t lava_source = CONTENT_IGNORE);