metaforce/Runtime/World/CAi.cpp

46 lines
1.3 KiB
C++
Raw Normal View History

#include "CAi.hpp"
2016-04-24 02:46:13 +00:00
#include "Character/CModelData.hpp"
#include "CStateManager.hpp"
2016-09-17 06:40:45 +00:00
#include "CStateMachine.hpp"
2016-03-04 23:04:53 +00:00
namespace urde
{
2016-04-24 02:46:13 +00:00
static CMaterialList MakeAiMaterialList(const CMaterialList& in)
{
CMaterialList ret = in;
ret.Add(EMaterialTypes::FourtyEight);
ret.Add(EMaterialTypes::TwentyOne);
return ret;
}
CAi::CAi(TUniqueId uid, bool active, const std::string& name, const CEntityInfo& info, const zeus::CTransform& xf,
2016-09-01 09:31:18 +00:00
CModelData&& mData, const zeus::CAABox& box, float mass, const CHealthInfo& hInfo,
const CDamageVulnerability& dmgVuln, const CMaterialList& list, ResId, const CActorParameters& actorParams,
float stepUp, float stepDown)
: CPhysicsActor(uid, active, name, info, xf, std::move(mData), MakeAiMaterialList(list), box, SMoverData(mass),
actorParams, stepUp, stepDown),
2016-04-24 02:46:13 +00:00
x258_healthInfo(hInfo),
x260_damageVulnerability(dmgVuln)
{
}
CAiStateFunc CAi::GetStateFunc(const char* func)
{
return m_FuncMap->GetStateFunc(func);
}
CAiTriggerFunc CAi::GetTrigerFunc(const char* func)
{
return m_FuncMap->GetTriggerFunc(func);
}
2016-09-17 06:40:45 +00:00
const CStateMachine*CAi::GetStateMachine() const { return x2c8_stateMachine.GetObj(); }
2016-04-24 02:46:13 +00:00
void CAi::CreateFuncLookup(CAiFuncMap* funcMap)
{
m_FuncMap = funcMap;
}
CAiFuncMap* CAi::m_FuncMap = nullptr;
}