refactor WorldGenerator & update test generator script

This commit is contained in:
MihailRis
2024-08-23 03:07:02 +03:00
parent f2395dede8
commit f40ff7cd28
4 changed files with 23 additions and 18 deletions
+9 -3
View File
@@ -1,8 +1,10 @@
#pragma once
#include <string>
#include <memory>
#include "typedefs.hpp"
#include "voxels/voxel.hpp"
struct voxel;
class Content;
@@ -12,10 +14,15 @@ struct GeneratorDef;
class WorldGenerator {
const GeneratorDef& def;
const Content* content;
uint64_t seed;
public:
/// @param def generator definition
/// @param content world content
/// @param seed world seed
WorldGenerator(
const GeneratorDef& def,
const Content* content
const Content* content,
uint64_t seed
);
virtual ~WorldGenerator() = default;
@@ -23,8 +30,7 @@ public:
/// @param voxels destinatiopn chunk voxels buffer
/// @param x chunk position X divided by CHUNK_W
/// @param z chunk position Y divided by CHUNK_D
/// @param seed world seed
virtual void generate(voxel* voxels, int x, int z, uint64_t seed);
virtual void generate(voxel* voxels, int x, int z);
inline static std::string DEFAULT = "core:default";
};