7#include <unordered_map>
8#include <spdlog/spdlog.h>
18template <
typename Resource,
typename Identifier = std::
string>
26 template <
typename... Parameters>
29 const std::string& filename,
30 Parameters&&... args);
34 template <
typename... Parameters>
37 Parameters&&... args);
41 const Resource&
get (
const Identifier&
id)
const;
45 Resource&
get (
const Identifier&
id);
49 std::unique_ptr <Resource>&& resource,
51 const std::string& filename);
53 std::unordered_map <Identifier, std::vector <std::string>> m_filesPath;
54 using PtrResource = std::unique_ptr <Resource>;
55 std::unordered_map <Identifier, PtrResource> m_resources;
allow to store and load Gui layou
Definition Layout.h:33
load and hold resources of all kind (image, music, etc.), that can be retrieved with Identifier that ...
Definition ResourcesHolder.h:20
const Resource & get(const Identifier &id) const
get resource from its identifier, return first element if id was not registered
Resource & get(const Identifier &id)
get mutable resource from its identifier, return first element if id was not registered
bool reload(const Identifier &id, Parameters &&... args)
reload resource from file (will not work if load was not called before)
bool load(const Identifier &id, const std::string &filename, Parameters &&... args)
load resource from file. Note that for TextContainer or GuiLayout, you can store resource in several ...
store text accessible with a string key, with option to load and store text for a given tongue,...
Definition TextContainer.h:15
Contains texture position and sub-box of all sprites for a given sprite sheet. Animations ca be handl...
Definition TextureAtlas.h:28
Definition Interpolation.h:9
Definition Interpolation.h:16
ResourcesHolder< sf::Font > FontHolder
Definition ResourcesHolder.h:78
ResourcesHolder< sf::Shader > ShaderHolder
Definition ResourcesHolder.h:76
ResourcesHolder< sf::SoundBuffer > SoundHolder
Definition ResourcesHolder.h:77
ResourcesHolder< sf::Texture > TextureHolder
Definition ResourcesHolder.h:75
ResourcesHolder< TextureAtlas > AtlasHolder
Definition ResourcesHolder.h:81
ResourcesHolder< TextContainer > TextHolder
Definition ResourcesHolder.h:82
ResourcesHolder< Layout > LayoutHolder
Definition ResourcesHolder.h:80