18 lines
526 B
C++
18 lines
526 B
C++
#include "resourcemanager.h"
|
|
|
|
std::unordered_map<std::string, std::unordered_map<std::string, void*>> ResourceManager::data;
|
|
|
|
void ResourceManager::add(void* resource, const std::string &type, const std::string name)
|
|
{
|
|
data[type][name] = resource;
|
|
}
|
|
|
|
void* ResourceManager::get(const std::string &type, const std::string name)
|
|
{
|
|
return check(type,name) ? data[type][name] : NULL;
|
|
}
|
|
|
|
bool ResourceManager::check(const std::string &type, const std::string name){
|
|
return data.count(type) && data[type].count(name);
|
|
}
|