Resource Manager - need a nudge in the right direction

closed account (423hURfi)
I'm trying to build a resource manager for an sfml game and I've reached a point where I am just stuck. Here, is the header file I have at the moment:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#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.
Topic archived. No new replies allowed.