format: reformat project

Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
Vyacheslav Ivanov
2024-08-03 19:53:48 +03:00
committed by Pugemon
parent 736cd175d5
commit bbf33e8e4d
202 changed files with 7389 additions and 5609 deletions
+17 -14
View File
@@ -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_