31 lines
606 B
C++
31 lines
606 B
C++
#pragma once
|
|
|
|
#include "behaviac/behaviac.h"
|
|
#include "behaviac_customized_types.h"
|
|
|
|
struct BtContext;
|
|
class BaseAgent;
|
|
class BtCoroutine
|
|
{
|
|
public:
|
|
|
|
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);
|
|
const char* GetName() const { return name_; }
|
|
|
|
private:
|
|
std::shared_ptr<BtContext> context_;
|
|
const char* name_ = nullptr;
|
|
|
|
};
|