update ContentLoader part 1

This commit is contained in:
MihailRis
2024-06-26 23:36:01 +03:00
parent f135896683
commit 8d41f6af11
5 changed files with 98 additions and 54 deletions
+14 -7
View File
@@ -4,6 +4,7 @@
#include "../typedefs.hpp"
#include <string>
#include <memory>
#include <filesystem>
namespace fs = std::filesystem;
@@ -11,8 +12,10 @@ namespace fs = std::filesystem;
class Block;
struct BlockMaterial;
struct ItemDef;
struct EntityDef;
struct ContentPack;
class ContentBuilder;
struct ContentPackStats;
namespace dynamic {
class Map;
@@ -21,16 +24,20 @@ namespace dynamic {
class ContentLoader {
const ContentPack* pack;
scriptenv env;
ContentBuilder& builder;
ContentPackStats* stats;
void loadBlock(Block& def, const std::string& full, const std::string& name);
void loadCustomBlockModel(Block& def, dynamic::Map* primitives);
void loadItem(ItemDef& def, const std::string& full, const std::string& name);
void loadBlockMaterial(BlockMaterial& def, const fs::path& file);
void loadEntity(EntityDef& def, const std::string& full, const std::string& name);
void loadBlock(Block& def, const std::string& name, const fs::path& file);
void loadItem(ItemDef& def, const std::string& name, const fs::path& file);
static void loadCustomBlockModel(Block& def, dynamic::Map* primitives);
static void loadBlockMaterial(BlockMaterial& def, const fs::path& file);
static void loadBlock(Block& def, const std::string& name, const fs::path& file);
static void loadItem(ItemDef& def, const std::string& name, const fs::path& file);
static void loadEntity(EntityDef& def, const std::string& name, const fs::path& file);
public:
ContentLoader(ContentPack* pack);
ContentLoader(ContentPack* pack, ContentBuilder& builder);
bool fixPackIndices(
const fs::path& folder,
@@ -38,7 +45,7 @@ public:
const std::string& contentSection
);
void fixPackIndices();
void load(ContentBuilder& builder);
void load();
};
#endif // CONTENT_CONTENT_LOADER_HPP_