add GeneratorScript

This commit is contained in:
MihailRis
2024-08-14 17:12:12 +03:00
parent 6f5eb6be48
commit 95cf451cc8
12 changed files with 196 additions and 51 deletions
+14 -1
View File
@@ -1,10 +1,23 @@
#pragma once
#include <string>
#include <glm/glm.hpp>
#include "typedefs.hpp"
#include "maths/Heightmap.hpp"
class GeneratorScript {
public:
virtual ~GeneratorScript() = default;
virtual std::shared_ptr<Heightmap> generateHeightmap(
const glm::ivec2& offset, const glm::ivec2& size) = 0;
};
struct GeneratorDef {
std::string name;
scriptenv env;
std::unique_ptr<GeneratorScript> script;
GeneratorDef(std::string name) : name(std::move(name)) {}
GeneratorDef(const GeneratorDef&) = delete;
};