This commit is contained in:
aozhiwei 2023-11-04 21:50:12 +08:00
parent 3d9d01a0f1
commit 19f31f7dea
12 changed files with 33 additions and 17 deletions

View File

@ -7,7 +7,7 @@ class AndroidAgent : public HeroAgent
public:
AndroidAgent();
virtual ~AndroidAgent();
virtual ~AndroidAgent() override;
BEHAVIAC_DECLARE_AGENTTYPE(AndroidAgent, HeroAgent)

View File

@ -5,14 +5,16 @@
#include <f8/btmgr.h>
#include "room.h"
#include "perft.h"
BaseAgent::BaseAgent():behaviac::Agent()
{
++Perf::Instance()->agent_num;
}
BaseAgent::~BaseAgent()
{
--Perf::Instance()->agent_num;
}
bool BaseAgent::IsGameOver()

View File

@ -6,6 +6,21 @@
#include "base_agent.h"
#include "btcontext.h"
#include "btevent.h"
#include "perft.h"
BtCoroutine::BtCoroutine(std::shared_ptr<BtContext> context, int id, const char* name)
{
context_ = context;
id_ = id;
name_ = name;
INIT_LIST_HEAD(&entry);
++Perf::Instance()->bt_co_num;
}
BtCoroutine::~BtCoroutine()
{
--Perf::Instance()->bt_co_num;
}
void BtCoroutine::Abort(long long frameno)
{

View File

@ -17,13 +17,8 @@ class BtCoroutine
long long abort_frameno = 0;
behaviac::EBTStatus status = behaviac::BT_RUNNING;
BtCoroutine(std::shared_ptr<BtContext> context, int id, const char* name)
{
context_ = context;
id_ = id;
name_ = name;
INIT_LIST_HEAD(&entry);
}
BtCoroutine(std::shared_ptr<BtContext> context, int id, const char* name);
virtual ~BtCoroutine();
const char* GetName() const { return name_; }
auto GetContext() { return context_; }

View File

@ -18,6 +18,7 @@
#include "glmhelper.h"
#include "pbutils.h"
#include "creature.h"
#include "perf.h"
#include "mt/Param.h"
#include "mt/Buff.h"
@ -27,12 +28,12 @@
Buff::Buff()
{
++Perf::Instance()->buff_num;
}
Buff::~Buff()
{
int i = 0;
--Perf::Instance()->buff_num;
}
void Buff::Init()

View File

@ -39,7 +39,7 @@ class Buff
std::shared_ptr<std::vector<float>> buff_vars;
Buff();
~Buff();
virtual ~Buff();
void Init();
void UnInit();
int GetLeftTime();

View File

@ -5,14 +5,17 @@
#include "human.h"
#include "app.h"
#include "perfmonitor.h"
#include "perft.h"
Entity::Entity()
{
entity_weak_ptr_chunk_.Set(this);
++Perf::Instance()->entity_num;
}
Entity::~Entity()
{
--Perf::Instance()->entity_num;
}
void Entity::Initialize()

View File

@ -21,7 +21,7 @@ class HeroAgent : public BaseAgent
public:
HeroAgent();
virtual ~HeroAgent();
virtual ~HeroAgent() override;
BEHAVIAC_DECLARE_AGENTTYPE(HeroAgent, BaseAgent)

View File

@ -9,7 +9,7 @@ class MasterAgent : public BaseAgent
public:
MasterAgent();
virtual ~MasterAgent();
virtual ~MasterAgent() override;
BEHAVIAC_DECLARE_AGENTTYPE(MasterAgent, BaseAgent)

View File

@ -9,7 +9,7 @@ class RoomAgent : public BaseAgent
public:
RoomAgent();
virtual ~RoomAgent();
virtual ~RoomAgent() override;
BEHAVIAC_DECLARE_AGENTTYPE(RoomAgent, BaseAgent)

View File

@ -9,7 +9,7 @@ class TargetAgent : public BaseAgent
public:
TargetAgent();
virtual ~TargetAgent();
virtual ~TargetAgent() override;
BEHAVIAC_DECLARE_AGENTTYPE(TargetAgent, BaseAgent)

View File

@ -9,7 +9,7 @@ class TeamAgent : public BaseAgent
public:
TeamAgent();
virtual ~TeamAgent();
virtual ~TeamAgent() override;
BEHAVIAC_DECLARE_AGENTTYPE(TeamAgent, BaseAgent)