DarkflameServer/dGame/dUtilities/BrickDatabase.h

30 lines
491 B
C
Raw Normal View History

#pragma once
#include "Entity.h"
class BrickDatabase
{
public:
2022-07-28 13:39:57 +00:00
static BrickDatabase* Instance() {
if (m_Address == nullptr) {
m_Address = new BrickDatabase();
}
2022-07-28 13:39:57 +00:00
return m_Address;
}
2022-07-28 13:39:57 +00:00
std::vector<Brick>& GetBricks(const std::string& lxfmlPath);
2022-07-28 13:39:57 +00:00
explicit BrickDatabase();
~BrickDatabase();
private:
2022-07-28 13:39:57 +00:00
std::unordered_map<std::string, std::vector<Brick>> m_Cache;
2022-07-28 13:39:57 +00:00
static std::vector<Brick> emptyCache;
2022-07-28 13:39:57 +00:00
static BrickDatabase* m_Address; //For singleton method
2022-07-28 13:39:57 +00:00
/* data */
};