metaforce/Runtime/Character/CMetaAnimFactory.cpp

32 lines
835 B
C++
Raw Normal View History

2016-04-10 21:22:59 +00:00
#include "CMetaAnimFactory.hpp"
#include "CMetaAnimPlay.hpp"
#include "CMetaAnimBlend.hpp"
#include "CMetaAnimPhaseBlend.hpp"
#include "CMetaAnimRandom.hpp"
#include "CMetaAnimSequence.hpp"
2018-12-08 05:30:43 +00:00
namespace urde {
2016-04-10 21:22:59 +00:00
2018-12-08 05:30:43 +00:00
std::shared_ptr<IMetaAnim> CMetaAnimFactory::CreateMetaAnim(CInputStream& in) {
EMetaAnimType type = EMetaAnimType(in.readUint32Big());
2016-04-10 21:22:59 +00:00
2018-12-08 05:30:43 +00:00
switch (type) {
case EMetaAnimType::Play:
return std::make_shared<CMetaAnimPlay>(in);
case EMetaAnimType::Blend:
return std::make_shared<CMetaAnimBlend>(in);
case EMetaAnimType::PhaseBlend:
return std::make_shared<CMetaAnimPhaseBlend>(in);
case EMetaAnimType::Random:
return std::make_shared<CMetaAnimRandom>(in);
case EMetaAnimType::Sequence:
return std::make_shared<CMetaAnimSequence>(in);
default:
break;
}
2016-04-10 21:22:59 +00:00
2018-12-08 05:30:43 +00:00
return {};
2016-04-10 21:22:59 +00:00
}
2018-12-08 05:30:43 +00:00
} // namespace urde