format: reformat project
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
#ifndef CONTENT_CONTENT_BUILDER_HPP_
|
||||
#define CONTENT_CONTENT_BUILDER_HPP_
|
||||
|
||||
#include "../items/ItemDef.hpp"
|
||||
#include "../voxels/Block.hpp"
|
||||
#include "../objects/EntityDef.hpp"
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "../content/Content.hpp"
|
||||
#include "../content/ContentPack.hpp"
|
||||
#include "../items/ItemDef.hpp"
|
||||
#include "../objects/EntityDef.hpp"
|
||||
#include "../voxels/Block.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
template<class T>
|
||||
template <class T>
|
||||
class ContentUnitBuilder {
|
||||
std::unordered_map<std::string, contenttype>& allNames;
|
||||
contenttype type;
|
||||
@@ -19,17 +19,20 @@ class ContentUnitBuilder {
|
||||
void checkIdentifier(const std::string& id) {
|
||||
const auto& found = allNames.find(id);
|
||||
if (found != allNames.end()) {
|
||||
throw namereuse_error("name "+id+" is already used", found->second);
|
||||
throw namereuse_error(
|
||||
"name " + id + " is already used", found->second
|
||||
);
|
||||
}
|
||||
}
|
||||
public:
|
||||
UptrsMap<std::string, T> defs;
|
||||
std::vector<std::string> names;
|
||||
|
||||
|
||||
ContentUnitBuilder(
|
||||
std::unordered_map<std::string, contenttype>& allNames,
|
||||
contenttype type
|
||||
) : allNames(allNames), type(type) {}
|
||||
std::unordered_map<std::string, contenttype>& allNames, contenttype type
|
||||
)
|
||||
: allNames(allNames), type(type) {
|
||||
}
|
||||
|
||||
T& create(const std::string& id) {
|
||||
auto found = defs.find(id);
|
||||
@@ -69,4 +72,4 @@ public:
|
||||
std::unique_ptr<Content> build();
|
||||
};
|
||||
|
||||
#endif // CONTENT_CONTENT_BUILDER_HPP_
|
||||
#endif // CONTENT_CONTENT_BUILDER_HPP_
|
||||
|
||||
Reference in New Issue
Block a user