#ifndef RESOURCEMANAGER_H
#define RESOURCEMANAGER_H

#include <string>
#include <unordered_map>

#define RESOURCE_ADD(ptr, type, name) ResourceManager::add((void*)ptr, #type, name)

#define RESOURCE_GET(type, name) ((type*)(ResourceManager::get(#type, name)))

#define RESOURCE_CHECK(type, name) ResourceManager::check(#type, name)

#define RESOURCE_REMOVE(type, name) ResourceManager::remove(#type, name)

namespace ResourceManager
{
    std::unordered_map<std::string, std::unordered_map<std::string, void*>> getResourceMap();

    void  add(void* resource, const std::string &type, const std::string name);
    void  remove(const std::string &type, const std::string name);
    void* get(const std::string &type, const std::string name);
    bool  check(const std::string &type, const std::string name);
}

#endif // RESOURCEMANAGER_H
