3 #include <unordered_map> 26 template <Concepts::LoadableResourceT T>
30 template <Concepts::LoadableResourceT T>
34 template <Concepts::LoadableResourceT T>
44 MOUNTAIN_API
static void LoadAll();
52 MOUNTAIN_API
static bool_t
Contains(
const std::string& name);
61 MOUNTAIN_API
static bool_t
IsBinary(
const std::string& name);
64 template <Concepts::ResourceT T = Resource>
69 template <Concepts::ResourceT T = Resource>
82 template <Concepts::ResourceT T = Resource>
90 MOUNTAIN_API
static void Rename(
const std::string& name,
const std::string& newName);
101 template <Concepts::ResourceT T>
106 template <Concepts::ResourceT T>
115 template <Concepts::ResourceT T = Resource>
125 template <Concepts::ResourceT T = Resource>
130 template <Concepts::ResourceT T>
134 template <Concepts::ResourceT T>
139 MOUNTAIN_API
static void Unload(
const std::string& name);
142 template <Concepts::ResourceT T>
149 MOUNTAIN_API
static inline std::unordered_map<std::string, Pointer<Resource>> m_Resources;
150 MOUNTAIN_API
static inline std::mutex m_ResourcesMutex;
151 MOUNTAIN_API
static inline std::unordered_map<Guid, std::string> m_GuidMap;
153 template <Concepts::ResourceT T>
154 static Pointer<T> AddNoCheck(std::string name);
156 template <Concepts::ResourceT T>
159 template <Concepts::ResourceT T>
161 static Pointer<T> GetNoCheck(
const std::string& name);
165 #include "Mountain/resource/resource_manager.inl" static MOUNTAIN_API void LoadAll()
Creates one Resource for each FileManager entry.
Defines the Mountain::List class.
static MOUNTAIN_API void LoadAllBinaries()
Loads all embedded binary Resources created using std::embed.
Defines the Mountain::File class.
static MOUNTAIN_API Pointer< Font > LoadFont(const Pointer< File > &file, uint32_t size)
Creates the Font corresponding to the given file and loads it with the given size.
static MOUNTAIN_API void Rename(const std::string &name, const std::string &newName)
Renames the Resource with the given name to newName.
Defines the Mountain::Logger static class.
A dynamic array implementation. Wrapper around the std::vector class.
static MOUNTAIN_API void UnloadAll()
Unloads all stored Resources.
static List< Pointer< T > > FindAll()
Finds all Resource of type T.
Defines the Mountain::Resource class.
Static class used to add, load, get, or unload Resources.
static bool_t IsResourceOfType(const std::string &name)
Checks whether the given name corresponds to a Resource of type T.
Custom Mountain smart pointer. Represents both a std::shared_ptr and a std::weak_ptr.
static Pointer< T > Get(const std::string &name)
Returns the Resource that was either added or loaded using the given name.
static MOUNTAIN_API bool_t Contains(const std::string &name)
Checks whether the ResourceManager contains the specified Resource name.
static Pointer< T > Add(const std::string &name)
Creates the Resource corresponding to the given name without loading it.
static MOUNTAIN_API Pointer< Font > GetFont(const std::string &name, uint32_t size)
Returns the Font that was loaded using the given name and size.
static MOUNTAIN_API void Unload(const std::string &name)
Unloads the Resource with the given name.
Defines the Mountain::Pointer class.
static Pointer< T > Find(const std::function< bool_t(Pointer< T >)> &predicate)
Finds a specific Resource based on a predicate.
static Pointer< T > Load(const Pointer< File > &file, bool_t loadInInterface=true)
Creates the Resource corresponding to the given file and loads it.
Stands for Global Unique Identifier, it represents a unique ID that's used to link pointers during se...
static MOUNTAIN_API bool_t IsBinary(const std::string &name)
Checks whether the given Resource name is an embedded binary Resource.
Contains all declarations of the Mountain Framework.