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
+18 -14
View File
@@ -1,26 +1,30 @@
#include "ContentLUT.hpp"
#include "Content.hpp"
#include "../constants.hpp"
#include "../files/files.hpp"
#include "../coders/json.hpp"
#include "../voxels/Block.hpp"
#include "../items/ItemDef.hpp"
#include <memory>
ContentLUT::ContentLUT(const ContentIndices* indices, size_t blocksCount, size_t itemsCount)
: blocks(blocksCount, indices->blocks, BLOCK_VOID, contenttype::block),
items(itemsCount, indices->items, ITEM_VOID, contenttype::item)
{}
#include "../coders/json.hpp"
#include "../constants.hpp"
#include "../files/files.hpp"
#include "../items/ItemDef.hpp"
#include "../voxels/Block.hpp"
#include "Content.hpp"
template<class T> static constexpr size_t get_entries_count(
const ContentUnitIndices<T>& indices, const dynamic::List_sptr& list) {
ContentLUT::ContentLUT(
const ContentIndices* indices, size_t blocksCount, size_t itemsCount
)
: blocks(blocksCount, indices->blocks, BLOCK_VOID, contenttype::block),
items(itemsCount, indices->items, ITEM_VOID, contenttype::item) {
}
template <class T>
static constexpr size_t get_entries_count(
const ContentUnitIndices<T>& indices, const dynamic::List_sptr& list
) {
return list ? std::max(list->size(), indices.count()) : indices.count();
}
std::shared_ptr<ContentLUT> ContentLUT::create(
const fs::path& filename,
const Content* content
const fs::path& filename, const Content* content
) {
auto root = files::read_json(filename);
auto blocklist = root->list("blocks");