46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
#ifndef RESOURCEBASE_H
|
|
#define RESOURCEBASE_H
|
|
|
|
class Texture;
|
|
class Mesh;
|
|
class Material;
|
|
class Shader;
|
|
class Entity;
|
|
|
|
#include <unordered_map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class ResourceBase
|
|
{
|
|
private:
|
|
std::vector<std::string> textureNames;
|
|
std::vector<std::string> meshNames;
|
|
std::vector<std::string> materialNames;
|
|
std::vector<std::string> shaderNames;
|
|
std::vector<std::string> entityNames;
|
|
|
|
std::unordered_map<std::string, Texture*> textures;
|
|
std::unordered_map<std::string, Mesh*> meshes;
|
|
std::unordered_map<std::string, Material*> materials;
|
|
std::unordered_map<std::string, Shader*> shaders;
|
|
std::unordered_map<std::string, Entity*> entities;
|
|
public:
|
|
ResourceBase();
|
|
~ResourceBase();
|
|
|
|
void addTexture(std::string textureName, Texture* myTexture);
|
|
void addMesh(std::string meshName, Mesh* myMesh);
|
|
void addMaterial(std::string materialName, Material* myMaterial);
|
|
void addShader(std::string shaderName, Shader* myShader);
|
|
void addEntity(std::string entityName, Entity* myEntity);
|
|
|
|
Texture* getTexture(std::string textureName);
|
|
Mesh* getMesh(std::string meshName);
|
|
Material* getMaterial(std::string materialName);
|
|
Shader* getShader(std::string shaderName);
|
|
Entity* getEntity(std::string entityName);
|
|
};
|
|
|
|
#endif // RESOURCEBASE_H
|