add generator definition file (.toml)

This commit is contained in:
MihailRis
2024-09-26 22:26:01 +03:00
parent d839da7dab
commit 3d478aef08
12 changed files with 76 additions and 54 deletions
+6 -7
View File
@@ -135,19 +135,12 @@ public:
const glm::ivec2& offset, const glm::ivec2& size, uint64_t seed) = 0;
virtual std::vector<StructurePlacement> placeStructures(
const GeneratorDef& def,
const glm::ivec2& offset, const glm::ivec2& size, uint64_t seed,
const std::shared_ptr<Heightmap>& heightmap) = 0;
/// @brief Get generator biomes
virtual const std::vector<Biome>& getBiomes() const = 0;
/// @return Number of biome parameters, that biome choosing depending on
virtual uint getBiomeParameters() const = 0;
/// @return Sea level (top of seaLayers)
virtual uint getSeaLevel() const = 0;
/// @brief Build the runtime cache
/// @param content built content
virtual void prepare(const GeneratorDef& def, const Content* content) = 0;
@@ -169,6 +162,12 @@ struct GeneratorDef {
std::string name;
std::unique_ptr<GeneratorScript> script;
/// @brief Sea level (top of seaLayers)
uint seaLevel = 0;
/// @brief Number of biome parameters, that biome choosing depending on
uint biomeParameters = 0;
std::unordered_map<std::string, size_t> structuresIndices;
std::vector<std::unique_ptr<GeneratingVoxelStructure>> structures;