prime/include/Kyoto/CResFactory.hpp

57 lines
1.6 KiB
C++
Raw Normal View History

#ifndef _CRESFACTORY
#define _CRESFACTORY
#include "types.h"
#include "rstl/list.hpp"
2022-08-09 23:03:51 +00:00
#include "Kyoto/CFactoryMgr.hpp"
#include "Kyoto/CResLoader.hpp"
class IFactory {
2022-09-14 05:24:12 +00:00
public:
virtual ~IFactory() {}
virtual CFactoryFnReturn Build(const SObjectTag&, const CVParamTransfer&, CObjectReference*) = 0;
2022-09-18 06:05:46 +00:00
virtual void BuildAsync(const SObjectTag&, const CVParamTransfer&, rstl::auto_ptr< IObj >*,
CObjectReference*) = 0;
2022-09-14 05:24:12 +00:00
virtual void CancelBuild(const SObjectTag&) = 0;
virtual bool CanBuild(const SObjectTag&) = 0;
virtual const SObjectTag* GetResourceIdByName(const char* name) const = 0;
// TODO
};
class CResFactory : public IFactory {
public:
CResFactory();
2022-10-01 06:19:09 +00:00
~CResFactory() override {}
CFactoryFnReturn Build(const SObjectTag&, const CVParamTransfer&, CObjectReference*) override;
void BuildAsync(const SObjectTag&, const CVParamTransfer&, rstl::auto_ptr< IObj >*,
CObjectReference*) override;
void CancelBuild(const SObjectTag&) override;
bool CanBuild(const SObjectTag&) override;
const SObjectTag* GetResourceIdByName(const char* name) const override;
void AsyncIdle(uint time);
CResLoader& GetResLoader() { return x4_resLoader; }
2022-11-14 14:16:52 +00:00
FourCC GetResourceTypeById(CAssetId id) { return GetResLoader().GetResourceTypeById(id); }
private:
CResLoader x4_resLoader;
CFactoryMgr x5c_factoryMgr;
uint x94_;
uint x98_;
uint x9c_;
uint xa0_;
uint xa4_;
uint xa8_;
uint xac_;
rstl::list< unkptr > xb0_;
};
CHECK_SIZEOF(CResFactory, 0xc8);
extern CResFactory* gpResourceFactory;
#endif // _CRESFACTORY