1
This commit is contained in:
parent
3d62b9c0c3
commit
d6038d8400
31
cpp/btmgr.cc
31
cpp/btmgr.cc
@ -5,39 +5,48 @@
|
|||||||
|
|
||||||
namespace f8
|
namespace f8
|
||||||
{
|
{
|
||||||
void BtMgr::Init()
|
void BtMgr::Init(const std::string& file_path)
|
||||||
{
|
{
|
||||||
|
behaviac::Workspace::GetInstance()->SetFilePath(file_path.c_str());
|
||||||
behaviac::Workspace::GetInstance()->SetFileFormat(behaviac::Workspace::EFF_xml);
|
behaviac::Workspace::GetInstance()->SetFileFormat(behaviac::Workspace::EFF_xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BtMgr::UnInit()
|
void BtMgr::UnInit()
|
||||||
{
|
{
|
||||||
|
behaviac::Workspace::GetInstance()->Cleanup();
|
||||||
}
|
|
||||||
|
|
||||||
void BtMgr::SetFilePath(const std::string& file_path)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BtMgr::BtLoad(behaviac::Agent* agent, const char* relative_path, bool force)
|
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)
|
void BtMgr::BtSetCurrent(behaviac::Agent* agent, const char* relative_path)
|
||||||
{
|
{
|
||||||
|
if (!agent) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
agent->btsetcurrent(relative_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BtMgr::BtExec(behaviac::Agent* agent)
|
void BtMgr::BtExec(behaviac::Agent* agent)
|
||||||
{
|
{
|
||||||
|
if (!agent) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
agent->btexec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BtMgr::BtDestory(behaviac::Agent* agent)
|
void BtMgr::BtDestory(behaviac::Agent* agent)
|
||||||
{
|
{
|
||||||
|
if (!agent) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
behaviac::Agent::Destroy(agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,11 +14,9 @@ namespace f8
|
|||||||
friend class a8::Singleton<BtMgr>;
|
friend class a8::Singleton<BtMgr>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Init();
|
void Init(const std::string& file_path);
|
||||||
void UnInit();
|
void UnInit();
|
||||||
|
|
||||||
void SetFilePath(const std::string& file_path);
|
|
||||||
|
|
||||||
bool BtLoad(behaviac::Agent* agent, const char* relative_path, bool force = false);
|
bool BtLoad(behaviac::Agent* agent, const char* relative_path, bool force = false);
|
||||||
void BtSetCurrent(behaviac::Agent* agent, const char* relative_path);
|
void BtSetCurrent(behaviac::Agent* agent, const char* relative_path);
|
||||||
void BtExec(behaviac::Agent* agent);
|
void BtExec(behaviac::Agent* agent);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user