rendered paste body#ifndef DUNE_DATACACHE_H
#define DUNE_DATACACHE_H
#include <map>
#include <string>
#include <vector>
#include "SDL_mixer.h"
#include "SDL_image.h"
#include "singleton.h"
#include "houses.h"
#include "SoundPlayerClass.h"
typedef std::map <int, SDL_Surface*> images;
class DataCache: public Singleton<DataCache>
{
friend class Singleton<DataCache>;
friend class Singleton<SoundPlayer>;
public:
void add_image(int ID, std::string path);
void add_sound(int ID, std::string path);
void load_data();
SDL_Surface * get_image(int ID, int house = HOUSE_HARKONNEN);
Mix_Chunk * get_sound(int ID);
protected:
DataCache();
std::vector<images*> m_houseimages;
std::map<int, Mix_Chunk*> m_sounds;
};
#endif // DUNE_DATACACHE_H