6 #ifndef ResourceManager_hpp
7 #define ResourceManager_hpp
9 #include <SDL2_ttf/SDL_ttf.h>
11 #include <SDL2_mixer/SDL_mixer.h>
12 #include <SDL2_image/SDL_image.h>
13 #include <unordered_map>
28 std::map<std::string, SDL_Texture *> textureMap;
33 std::map<std::string, SDL_Surface *> surfaceMap;
38 std::map<std::string, TTF_Font *> fontMap;
43 std::map<std::string, Mix_Music *> soundMap;
48 std::map<std::string, Mix_Chunk *> soundEffectMap;
53 std::map<std::string, std::string> languageMap;
77 SDL_Texture *
loadTexture(std::string filePath, SDL_Renderer *renderer);
84 SDL_Surface *
loadSurface(std::string filePath, SDL_Renderer *renderer);
91 TTF_Font *
loadFont(std::string filePath,
int fontSize);
98 Mix_Music *
loadMusic(std::string filePath);
104 Mix_Chunk *
loadWAV(std::string filePath);
111 void setWords(std::string english, std::string french);
118 std::string
getWords(std::string phrase);
The resource manager is responsible for handling and managing resources regarding the game.
Definition: ResourceManager.hpp:23
static ResourceManager & getInstance()
Method used to get instance of ResourceManager class.
Definition: ResourceManager.cpp:8
void loadWords()
Method to load the words from multiple scripts in the script folder.
Definition: ResourceManager.cpp:130
Mix_Music * loadMusic(std::string filePath)
Method used to load Mix_Music object of respective music from its path.
Definition: ResourceManager.cpp:70
std::string getWords(std::string phrase)
Method used to get words based on the language, i.e English or French.
Definition: ResourceManager.cpp:108
TTF_Font * loadFont(std::string filePath, int fontSize)
Method used to load TTF_Font object of respective font from its path.
Definition: ResourceManager.cpp:47
void setWords(std::string english, std::string french)
Metohd used to set translation words in LanguageMap.
Definition: ResourceManager.cpp:102
SDL_Texture * loadTexture(std::string filePath, SDL_Renderer *renderer)
Method used to load Spritesheet of Images from their path.
Definition: ResourceManager.cpp:14
SDL_Surface * loadSurface(std::string filePath, SDL_Renderer *renderer)
Method used to load Spritesheet of Images from their path.
Definition: ResourceManager.cpp:31
Mix_Chunk * loadWAV(std::string filePath)
Method used to load Mix_Chunk object of respective music from its path.
Definition: ResourceManager.cpp:86
void setLanguage(int languageCode)
Method to set language so other methods can know which language phrase to return.
Definition: ResourceManager.cpp:125