mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 21:11:50 +00:00
add GeneratorScript
This commit is contained in:
parent
6f5eb6be48
commit
95cf451cc8
12 changed files with 196 additions and 51 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue