le2d v0.4.3
2D game engine framework
 
Loading...
Searching...
No Matches
le::AssetLoader Class Reference

Set of AssetTypeLoaders mapped to their corrseponding AssetTypes. More...

#include <le2d/asset/asset_loader.hpp>

Public Member Functions

void add_loader (std::unique_ptr< detail::IAssetTypeLoaderBase > loader)
 Associate a loader with its type.
 
template<std::derived_from< IAsset > AssetTypeT>
auto has_loader () const -> bool
 
template<std::derived_from< IAsset > AssetTypeT>
auto load (std::string_view const uri) const -> std::unique_ptr< AssetTypeT >
 Load an asset given its URI.
 

Detailed Description

Set of AssetTypeLoaders mapped to their corrseponding AssetTypes.

Member Function Documentation

◆ add_loader()

void le::AssetLoader::add_loader ( std::unique_ptr< detail::IAssetTypeLoaderBase loader)

Associate a loader with its type.

Parameters
loaderconcrete IAssetTypeLoader instance.

◆ has_loader()

template<std::derived_from< IAsset > AssetTypeT>
auto le::AssetLoader::has_loader ( ) const -> bool
inline
Template Parameters
AssetTypeTType of asset.
Returns
true if loader associated with AssetTypeT exists.

◆ load()

template<std::derived_from< IAsset > AssetTypeT>
auto le::AssetLoader::load ( std::string_view const  uri) const -> std::unique_ptr<AssetTypeT>
inline

Load an asset given its URI.

Template Parameters
AssetTypeTType of asset.
Parameters
uriURI to load from.
Returns
Asset instance if loaded, otherwise null.

The documentation for this class was generated from the following file: