// // Created by sebastian on 08.02.26. // #ifndef ASSETMANAGER_H #define ASSETMANAGER_H #include #include #include "json.hpp" #include "../model/TexturedModel.h" #include "Loader.h" #include "Texture2D.h" #include "../../core/gui/text/UiTheme.h" #include "../model/ModelStages.h" class Font; class AssetManager { public: static std::shared_ptr loadModel(const std::string& name, const std::string& objPath, const std::string& texturePath, Loader& loader); static std::shared_ptr getModel(const std::string& name); static void insertGeneratedModel(const std::string& name, std::shared_ptr model); static void loadAsset(const std::string& assetPath, Loader& loader); static std::shared_ptr getModelStages(const std::string& modelName); static std::shared_ptr getModelStageConfiguration(const std::string& modelName, const std::string& stageName); static std::shared_ptr loadTexture(const std::string &name, const std::string &texturePath, Loader &loader); static std::shared_ptr getTexture(const std::string& texturePath); static std::shared_ptr getUiTheme(const std::string& themeName); static std::shared_ptr loadUiTheme(const std::string& themeName, const std::string& themePath); static void insertLoadedTexture(const std::string& name, const Texture2D& texture); static void insertTexturedModel(const std::string & name, const TexturedModel & textured_model); static void insertModelStages(const std::string &name, ModelStages modelStages); private: static inline std::unordered_map> models; static inline std::unordered_map> modelsWithStages; static inline std::unordered_map> textures; static inline std::unordered_map> uiThemes; static nlohmann::json readJsonFile(const std::string &path); }; #endif //ASSETMANAGER_H