Add factory function

This commit is contained in:
Phillip Stephens 2016-08-16 14:12:27 -07:00
parent de7d5f9d59
commit bb0977733f
2 changed files with 10 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#include "CStringTable.hpp" #include "CStringTable.hpp"
#include "CToken.hpp"
namespace urde namespace urde
{ {
@ -76,4 +77,10 @@ void CStringTable::SetLanguage(s32 lang)
{ {
mCurrentLanguage = skLanguages[lang]; mCurrentLanguage = skLanguages[lang];
} }
CFactoryFnReturn FStringTableFactory(const SObjectTag&, CInputStream& in, const CVParamTransfer&)
{
return TToken<CStringTable>::GetIObjObjectFor(std::make_unique<CStringTable>(in));
}
} }

View File

@ -2,6 +2,7 @@
#define __URDE_CSTRINGTABLE_HPP__ #define __URDE_CSTRINGTABLE_HPP__
#include "RetroTypes.hpp" #include "RetroTypes.hpp"
#include "IFactory.hpp"
namespace urde namespace urde
{ {
@ -19,5 +20,7 @@ public:
std::wstring GetString(s32) const; std::wstring GetString(s32) const;
static void SetLanguage(s32); static void SetLanguage(s32);
}; };
CFactoryFnReturn FStringTableFactory(const SObjectTag&, CInputStream&, const CVParamTransfer&);
} }
#endif // __URDE_CSTRINGTABLE_HPP__ #endif // __URDE_CSTRINGTABLE_HPP__