1
This commit is contained in:
parent
720a3725e2
commit
0d6e388f3b
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include "base_agent.h"
|
#include "base_agent.h"
|
||||||
|
|
||||||
|
#include <f8/btmgr.h>
|
||||||
|
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
|
|
||||||
BaseAgent::BaseAgent():behaviac::Agent()
|
BaseAgent::BaseAgent():behaviac::Agent()
|
||||||
@ -48,6 +50,14 @@ float BaseAgent::RandRangeAsFloat(float min_val, float max_val)
|
|||||||
return RandRange(min_val, max_val);
|
return RandRange(min_val, max_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BaseAgent::Exec()
|
||||||
|
{
|
||||||
|
behaviac::EBTStatus status = f8::BtMgr::Instance()->BtExec(this);
|
||||||
|
if (status == behaviac::BT_RUNNING) {
|
||||||
|
CheckCoroutineEvent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
behaviac::EBTStatus BaseAgent::StartCoroutine(std::shared_ptr<BtCoroutine> co)
|
behaviac::EBTStatus BaseAgent::StartCoroutine(std::shared_ptr<BtCoroutine> co)
|
||||||
{
|
{
|
||||||
coroutines_hash_[co->GetId()] = co;
|
coroutines_hash_[co->GetId()] = co;
|
||||||
|
@ -43,6 +43,8 @@ public:
|
|||||||
|
|
||||||
BEHAVIAC_DECLARE_AGENTTYPE(BaseAgent, behaviac::Agent)
|
BEHAVIAC_DECLARE_AGENTTYPE(BaseAgent, behaviac::Agent)
|
||||||
|
|
||||||
|
void Exec();
|
||||||
|
|
||||||
bool IsGameOver();
|
bool IsGameOver();
|
||||||
int GetTickCount();
|
int GetTickCount();
|
||||||
int RandRange(int min_val, int max_val);
|
int RandRange(int min_val, int max_val);
|
||||||
|
@ -47,14 +47,6 @@ HeroAgent::~HeroAgent()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HeroAgent::Exec()
|
|
||||||
{
|
|
||||||
behaviac::EBTStatus status = f8::BtMgr::Instance()->BtExec(this);
|
|
||||||
if (status == behaviac::BT_RUNNING) {
|
|
||||||
CheckCoroutineEvent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HeroAgent::SetOwner(Creature* owner)
|
void HeroAgent::SetOwner(Creature* owner)
|
||||||
{
|
{
|
||||||
owner_ = owner;
|
owner_ = owner;
|
||||||
|
@ -25,7 +25,6 @@ public:
|
|||||||
|
|
||||||
BEHAVIAC_DECLARE_AGENTTYPE(HeroAgent, BaseAgent)
|
BEHAVIAC_DECLARE_AGENTTYPE(HeroAgent, BaseAgent)
|
||||||
|
|
||||||
void Exec();
|
|
||||||
void SetOwner(Creature* owner);
|
void SetOwner(Creature* owner);
|
||||||
|
|
||||||
int GetUniId();
|
int GetUniId();
|
||||||
|
@ -15,11 +15,6 @@ RoomAgent::~RoomAgent()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoomAgent::Exec()
|
|
||||||
{
|
|
||||||
behaviac::EBTStatus status = f8::BtMgr::Instance()->BtExec(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
int RoomAgent::GetMapId()
|
int RoomAgent::GetMapId()
|
||||||
{
|
{
|
||||||
return room_->GetMapMeta()->map_id();
|
return room_->GetMapMeta()->map_id();
|
||||||
@ -55,7 +50,6 @@ int RoomAgent::GetAliveTeamNum()
|
|||||||
return room_->GetAliveTeamNum();
|
return room_->GetAliveTeamNum();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HeroAgent* RoomAgent::FindHero(int hero_uniid)
|
HeroAgent* RoomAgent::FindHero(int hero_uniid)
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -13,8 +13,6 @@ public:
|
|||||||
|
|
||||||
BEHAVIAC_DECLARE_AGENTTYPE(RoomAgent, BaseAgent)
|
BEHAVIAC_DECLARE_AGENTTYPE(RoomAgent, BaseAgent)
|
||||||
|
|
||||||
void Exec();
|
|
||||||
|
|
||||||
int GetMapId();
|
int GetMapId();
|
||||||
int GetHumanNum();
|
int GetHumanNum();
|
||||||
int GetAliveHumanNum();
|
int GetAliveHumanNum();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user