2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2015-08-17 13:33:58 -07:00
|
|
|
|
2015-08-21 18:58:41 -07:00
|
|
|
#include "IObjectStore.hpp"
|
2016-02-04 17:27:03 -08:00
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
#include "IVParamObj.hpp"
|
|
|
|
#include <unordered_map>
|
2015-08-17 22:54:43 -07:00
|
|
|
|
2016-03-04 15:04:53 -08:00
|
|
|
namespace urde
|
2015-08-17 15:05:00 -07:00
|
|
|
{
|
2015-08-21 18:58:41 -07:00
|
|
|
class IFactory;
|
2016-02-04 17:27:03 -08:00
|
|
|
class CObjectReference;
|
2015-08-17 15:05:00 -07:00
|
|
|
|
2015-08-17 22:54:43 -07:00
|
|
|
class CSimplePool : public IObjectStore
|
2015-08-17 13:33:58 -07:00
|
|
|
{
|
2016-04-04 18:51:25 -07:00
|
|
|
protected:
|
2017-01-21 20:32:53 -08:00
|
|
|
u8 x4_;
|
|
|
|
u8 x5_;
|
|
|
|
std::unordered_map<SObjectTag, CObjectReference*> x8_resources;
|
|
|
|
IFactory& x18_factory;
|
|
|
|
CVParamTransfer x1c_paramXfer;
|
2015-08-17 22:54:43 -07:00
|
|
|
public:
|
2016-02-04 17:27:03 -08:00
|
|
|
CSimplePool(IFactory& factory);
|
2018-05-19 23:14:57 -07:00
|
|
|
~CSimplePool();
|
2016-02-04 17:27:03 -08:00
|
|
|
CToken GetObj(const SObjectTag&, const CVParamTransfer&);
|
|
|
|
CToken GetObj(const SObjectTag&);
|
2017-11-12 22:19:18 -08:00
|
|
|
CToken GetObj(std::string_view);
|
|
|
|
CToken GetObj(std::string_view, const CVParamTransfer&);
|
2016-02-04 21:52:05 -08:00
|
|
|
bool HasObject(const SObjectTag&) const;
|
|
|
|
bool ObjectIsLive(const SObjectTag&) const;
|
2017-01-21 20:32:53 -08:00
|
|
|
IFactory& GetFactory() const {return x18_factory;}
|
2016-02-04 17:27:03 -08:00
|
|
|
void Flush();
|
|
|
|
void ObjectUnreferenced(const SObjectTag&);
|
2017-02-11 19:17:18 -08:00
|
|
|
std::vector<SObjectTag> GetReferencedTags() const;
|
2015-08-17 13:33:58 -07:00
|
|
|
};
|
|
|
|
|
2015-08-17 15:05:00 -07:00
|
|
|
}
|
|
|
|
|