16template <
typename AssetType>
25 std::filesystem::path
path;
28template <
typename AssetType>
31 using Factory =
typename AssetType::Factory;
80template <
typename AssetType>
91template <
typename AssetType>
117 return std::make_shared<AssetType>(path, std::forward<Args>(
args)...);
120template <
typename AssetType>
122 auto component = std::make_shared<AssetType>(AssetType::Factory::create(type));
136template <
typename AssetType>
153template <
typename AssetType>
164template <
typename AssetType>
183 namespace fs = std::filesystem;
187 const auto assetPtr = std::make_shared<AssetType>(path,
args...);
195template <
typename AssetType>
199 const auto typeInt =
static_cast<int>(type);
201 const auto assetPtr = std::make_shared<AssetType>(AssetType::Factory::create(type));
#define SHKYERA_ASSERT(predicate,...)
Definition Assert.hpp:7
Definition AssetLoader.hpp:6
Definition Registry.hpp:28
Definition AssetUtils.hpp:29
~FactoryAssetLoader()=default
AssetType operator()() override
Definition AssetUtils.hpp:37
typename AssetType::Factory Factory
Definition AssetUtils.hpp:31
FactoryAssetLoader(Factory::Type type_)
Definition AssetUtils.hpp:33
Factory::Type type
Definition AssetUtils.hpp:39
Definition AssetUtils.hpp:17
std::filesystem::path path
Definition AssetUtils.hpp:25
~PathAssetLoader()=default
AssetType operator()() override
Definition AssetUtils.hpp:23
PathAssetLoader(std::filesystem::path path_)
Definition AssetUtils.hpp:19
Definition AssetLoaders.hpp:17
std::optional< AssetHandle > registerAll(std::filesystem::path path, Registry *registry)
Definition AssetUtils.cpp:49
std::optional< AssetHandle > registerSingle(std::filesystem::path path, Registry *registry)
Definition AssetUtils.cpp:22
std::vector< AssetHandle > getSubdirectories(AssetHandle directory, Registry const *registry)
Definition AssetUtils.cpp:67
HandleAndAsset< AssetType > add(Registry *registry, std::unique_ptr< AssetLoader< AssetType > > loader)
Definition AssetUtils.hpp:137
AssetRef< AssetType > read(AssetComponent< AssetType > &assetComponent)
Definition AssetUtils.hpp:81
AssetRef< AssetType > readPermanent(const std::filesystem::path &path, Args &&... args)
Definition AssetUtils.hpp:182
Entity AssetHandle
Definition Asset.hpp:8