5#ifndef __RESOURCE_MANAGER_H__
6#define __RESOURCE_MANAGER_H__
9#include <SFML/Audio.hpp>
19#define RM df::ResourceManager::getInstance()
25#define HEADER_TOKEN "HEADER"
26#define BODY_TOKEN "BODY"
27#define FOOTER_TOKEN "FOOTER"
28#define FRAMES_TOKEN "frames"
29#define TRANSPARENCY_TOKEN "transparency"
30#define HEIGHT_TOKEN "height"
31#define WIDTH_TOKEN "width"
32#define COLOR_TOKEN "color"
33#define SLOWDOWN_TOKEN "slowdown"
34#define END_FRAME_TOKEN "end"
35#define VERSION_TOKEN "version"
38const int MAX_SPRITES = 1000;
39const int MAX_SOUNDS = 100;
40const int MAX_MUSICS = 50;
59 Sprite *loadRobustSprite(std::ifstream *p_file);
63 Sprite *loadSimpleSprite(std::ifstream *p_file);
90 int loadSound(std::string filename, std::string label);
Definition: ResourceManager.h:42
int loadSprite(std::string filename, std::string label)
Load Sprite from file.
static ResourceManager & getInstance()
Get the one and only instance of the ResourceManager.
int startUp() override
Get ResourceManager ready to manage resources.
int m_sound_count
Count of number of loaded sounds.
Definition: ResourceManager.h:52
int m_sprite_count
Count of number of loaded sprites.
Definition: ResourceManager.h:49
int loadMusic(std::string filename, std::string label)
Associate file with Music.
Music * getMusic(std::string label)
Find Music with indicated label.
int loadSound(std::string filename, std::string label)
Load sound from file.
int m_music_count
Count of number of loaded musics.
Definition: ResourceManager.h:54
void shutDown() override
Shut down manager, freeing up any allocated Sprites, Music and Sounds.
Sound m_sound[MAX_SOUNDS]
Array of sound buffers.
Definition: ResourceManager.h:51
Sprite * getSprite(std::string label) const
Find Sprite with indicated label.
int unloadMusic(std::string label)
Remove label for Music with indicated label.
ResourceManager()
Private since a singleton.
Music m_music[MAX_MUSICS]
Array of music buffers.
Definition: ResourceManager.h:53
void operator=(ResourceManager const &)
Don't allow assignment.
Sound * getSound(std::string label)
Find Sound with indicated label.
int unloadSound(std::string label)
Remove Sound with indicated label.
Sprite * m_p_sprite[MAX_SPRITES]
Array of (pointers to) Sprites.
Definition: ResourceManager.h:48
ResourceManager(ResourceManager const &)
Don't allow copy.
int unloadSprite(std::string label)
Unload Sprite with indicated label.
An animation for a sprite.
Definition: Animation.h:15