game2006/server/gameserver/btcoroutine.h
aozhiwei ab8db13131 1
2023-06-21 23:06:22 +08:00

25 lines
532 B
C++

#pragma once
#include "behaviac/behaviac.h"
#include "behaviac_customized_types.h"
struct BtContext;
class BaseAgent;
struct BtCoroutine
{
std::shared_ptr<BtContext> context;
const char* name = nullptr;
std::function<behaviac::EBTStatus()> runing_cb;
long long sleep_end_frameno = 0;
int sleep_time = 0;
BtCoroutine(std::shared_ptr<BtContext> context, const char* name)
{
this->context = context;
this->name = name;
}
bool HasEvent();
void FireEvent(BaseAgent* agent);
};