metaforce/Runtime/Character/CMetaTransFactory.cpp

31 lines
763 B
C++
Raw Normal View History

2016-04-10 21:22:59 +00:00
#include "CMetaTransFactory.hpp"
#include "CMetaTransMetaAnim.hpp"
#include "CMetaTransTrans.hpp"
#include "CMetaTransPhaseTrans.hpp"
#include "CMetaTransSnap.hpp"
namespace urde
{
std::shared_ptr<IMetaTrans> CMetaTransFactory::CreateMetaTrans(CInputStream& in)
{
EMetaTransType type = EMetaTransType(in.readUint32Big());
switch (type)
{
case EMetaTransType::MetaAnim:
return std::make_shared<CMetaTransMetaAnim>(in);
case EMetaTransType::Trans:
return std::make_shared<CMetaTransTrans>(in);
case EMetaTransType::PhaseTrans:
return std::make_shared<CMetaTransPhaseTrans>(in);
case EMetaTransType::Snap:
2016-04-11 03:59:54 +00:00
return std::make_shared<CMetaTransSnap>();
2016-09-10 04:50:00 +00:00
default:
break;
2016-04-10 21:22:59 +00:00
}
return {};
}
}