#ifndef __URDE_CCHARACTERFACTORY_HPP__ #define __URDE_CCHARACTERFACTORY_HPP__ #include "IFactory.hpp" #include "IObjFactory.hpp" #include "CToken.hpp" #include "CSimplePool.hpp" #include "CAnimationSet.hpp" namespace urde { class CSimplePool; class CAnimCharacterSet; class CCharacterInfo; class CCharLayoutInfo; class CAdditiveAnimationInfo; class CTransitionDatabaseGame; class CAnimationManager; class CTransitionManager; class CAllFormatsAnimSource; class CAnimData; class CCharacterFactory : public IObjFactory { public: class CDummyFactory : public IFactory { public: CFactoryFnReturn Build(const SObjectTag&, const CVParamTransfer&, CObjectReference* selfRef); void BuildAsync(const SObjectTag&, const CVParamTransfer&, IObj**, CObjectReference* selfRef); void CancelBuild(const SObjectTag&); bool CanBuild(const SObjectTag&); const SObjectTag* GetResourceIdByName(const char*) const; FourCC GetResourceTypeById(ResId id) const; u32 ResourceSize(const urde::SObjectTag& tag); bool LoadResourceAsync(const urde::SObjectTag& tag, std::unique_ptr& target); bool LoadResourcePartAsync(const urde::SObjectTag& tag, u32 size, u32 off, std::unique_ptr& target); std::unique_ptr LoadResourceSync(const urde::SObjectTag& tag); std::unique_ptr LoadResourcePartSync(const urde::SObjectTag& tag, u32 size, u32 off); }; private: std::vector x4_charInfoDB; std::vector> x14_charLayoutInfoDB; std::shared_ptr x24_sysContext; std::shared_ptr x28_animMgr; std::shared_ptr x2c_transMgr; std::vector> x30_animSourceDB; std::vector> x40_additiveInfo; CAdditiveAnimationInfo x50_defaultAdditiveInfo; std::vector> x58_animResources; ResId x68_selfId; CDummyFactory x6c_dummyFactory; CSimplePool x70_cacheResPool; static std::vector GetCharacterInfoDB(const CAnimCharacterSet& ancs); static std::vector> GetCharLayoutInfoDB(CSimplePool& store, const std::vector& chars); public: CCharacterFactory(CSimplePool& store, const CAnimCharacterSet& ancs, ResId); std::unique_ptr CreateCharacter(int charIdx, bool loop, const TLockedToken& factory, int defaultAnim) const; ResId GetEventResourceIdForAnimResourceId(ResId animId) const; const CCharacterInfo& GetCharInfo(int charIdx) const { return x4_charInfoDB[charIdx]; } }; } #endif // __URDE_CCHARACTERFACTORY_HPP__