2021-12-05 17:54:36 +00:00
|
|
|
#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();
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
return m_Address;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
std::vector<Brick>& GetBricks(const std::string& lxfmlPath);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
explicit BrickDatabase();
|
|
|
|
|
|
|
|
~BrickDatabase();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
private:
|
2022-07-28 13:39:57 +00:00
|
|
|
std::unordered_map<std::string, std::vector<Brick>> m_Cache;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
static std::vector<Brick> emptyCache;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
static BrickDatabase* m_Address; //For singleton method
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
/* data */
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|