53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
#include "precompile.h"
|
|
|
|
#include "behaviac/behaviac.h"
|
|
#include "btmgr.h"
|
|
|
|
namespace f8
|
|
{
|
|
void BtMgr::Init(const std::string& file_path)
|
|
{
|
|
behaviac::Workspace::GetInstance()->SetFilePath(file_path.c_str());
|
|
behaviac::Workspace::GetInstance()->SetFileFormat(behaviac::Workspace::EFF_xml);
|
|
}
|
|
|
|
void BtMgr::UnInit()
|
|
{
|
|
behaviac::Workspace::GetInstance()->Cleanup();
|
|
}
|
|
|
|
bool BtMgr::BtLoad(behaviac::Agent* agent, const char* relative_path, bool force)
|
|
{
|
|
if (!agent) {
|
|
abort();
|
|
}
|
|
return agent->btload(relative_path, force);
|
|
}
|
|
|
|
void BtMgr::BtSetCurrent(behaviac::Agent* agent, const char* relative_path)
|
|
{
|
|
if (!agent) {
|
|
abort();
|
|
}
|
|
agent->btsetcurrent(relative_path);
|
|
}
|
|
|
|
void BtMgr::BtExec(behaviac::Agent* agent)
|
|
{
|
|
if (!agent) {
|
|
abort();
|
|
}
|
|
agent->btexec();
|
|
}
|
|
|
|
void BtMgr::BtDestory(behaviac::Agent* agent)
|
|
{
|
|
if (!agent) {
|
|
abort();
|
|
}
|
|
behaviac::Agent::Destroy(agent);
|
|
}
|
|
|
|
}
|
|
|