refactor WorldGenerator & update test generator script
This commit is contained in:
@@ -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";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user