#ifndef ResourceM_h
#define ResourceM_h
#include <string>
#include <map>
template <class T>
class ResourceManager<T>{
public:
ResourceManager(string directory);//constructor
~ResourceManager();
//for changing directory path when different set of resources are needed
string Directory{ set { this.directory = value;}}
load();//will load all the resources to the map at the directory
const T& getResource(string key); //returns the resource at specified key
protected:
map<string, T> resources;
string directory;
};
#endif
First, thing I wanted to know was if I am handling this the right way? I've read as much as I could on templates so I think I am doing that implementation correctly.
Secondly, I feel like I got the important methods and variables down, but I was wondering if there should be more?
I'm building a 2D game so the only resources I will be using is images and audio. I know this isn't a lot of code to go on (sorry for that), but I hope it's enough for someone to provide some insight.