format: reformat project
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
#ifndef WORLD_WORLDGENERATORS_HPP_
|
||||
#define WORLD_WORLDGENERATORS_HPP_
|
||||
|
||||
#include "../voxels/WorldGenerator.hpp"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "../voxels/WorldGenerator.hpp"
|
||||
|
||||
class Content;
|
||||
|
||||
typedef WorldGenerator* (*gen_constructor) (const Content*);
|
||||
|
||||
typedef WorldGenerator* (*gen_constructor)(const Content*);
|
||||
|
||||
class WorldGenerators {
|
||||
static inline std::map<std::string, gen_constructor> generators;
|
||||
|
||||
public:
|
||||
template <typename T>
|
||||
static void addGenerator(std::string id);
|
||||
@@ -23,16 +22,14 @@ public:
|
||||
static std::string getDefaultGeneratorID();
|
||||
|
||||
static std::unique_ptr<WorldGenerator> createGenerator(
|
||||
const std::string &id, const Content *content
|
||||
const std::string& id, const Content* content
|
||||
);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
void WorldGenerators::addGenerator(std::string id) {
|
||||
generators[id] =
|
||||
[] (const Content* content)
|
||||
{
|
||||
return (WorldGenerator*) new T(content);
|
||||
generators[id] = [](const Content* content) {
|
||||
return (WorldGenerator*)new T(content);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user