add LuaGeneratorScript::loadStructures
This commit is contained in:
@@ -101,7 +101,7 @@ public:
|
||||
virtual ~GeneratorScript() = default;
|
||||
|
||||
/// @brief Load all structures
|
||||
//virtual std::vector<std::shared_ptr<VoxelStructure>> loadStructures() = 0;
|
||||
virtual std::vector<std::shared_ptr<VoxelStructure>> loadStructures() = 0;
|
||||
|
||||
/// @brief Generates a heightmap with values in range 0..1
|
||||
/// @param offset position of the heightmap in the world
|
||||
|
||||
@@ -46,6 +46,8 @@ WorldGenerator::WorldGenerator(
|
||||
}
|
||||
generateHeightmap(found->second.get(), x, z);
|
||||
});
|
||||
|
||||
structures = def.script->loadStructures();
|
||||
}
|
||||
|
||||
WorldGenerator::~WorldGenerator() {}
|
||||
|
||||
@@ -62,7 +62,7 @@ class WorldGenerator {
|
||||
/// @brief Chunk prototypes loading surround map
|
||||
SurroundMap surroundMap;
|
||||
|
||||
std::vector<std::unique_ptr<VoxelStructure>> structures;
|
||||
std::vector<std::shared_ptr<VoxelStructure>> structures;
|
||||
|
||||
/// @brief Generate chunk prototype (see ChunkPrototype)
|
||||
/// @param x chunk position X divided by CHUNK_W
|
||||
|
||||
Reference in New Issue
Block a user