I'm trying to create a resource manager, here's my main abstract class for the other managers to inherit from. I'm trying to use a templated class so it can be generic:
Manager.h:
namespace ShockEngine {
template<class T> class Manager {
protected:
std::map<std::string, T> mediaList;
public:
virtual T getMedia(const T& fileName) = 0;
};
}
Here's my texture manager, which is a derived class of Manager:
TextureManager.h:
#include "Manager.h"
namespace ShockEngine {
class TextureManager: public Manager<sf::Texture> {
protected:
std::map<std::string, sf::Texture> textureList;
public:
TextureManager();
virtual ~TextureManager();
Manager<sf::Texture> addMedia(const std::string& fileName);
};
static TextureManager textureManager;
}
When I try to build and run this, 3 errors come up with my static definition of a texturemanager object, saying "Variable type TextureManager is an abstract class" I've tried to rewrite the template, use different techniques, but nothing works.