This commit is contained in:
aozhiwei 2023-10-11 15:34:40 +08:00
parent af9c01a306
commit 98ff269651
2 changed files with 31 additions and 0 deletions

View File

@ -2,6 +2,8 @@
#include "new_base_agent.h"
#include "room.h"
BaseAgent::BaseAgent():behaviac::Agent()
{
@ -10,3 +12,23 @@ BaseAgent::BaseAgent():behaviac::Agent()
BaseAgent::~BaseAgent()
{
}
bool BaseAgent::IsGameOver()
{
return room->IsGameOver();
}
int BaseAgent::GetTickCount()
{
return room->GetFrameNo() * FRAME_RATE_MS;
}
int BaseAgent::RandRange(int min_val, int max_val)
{
return a8::RandEx(min_val, max_val);
}
int BaseAgent::Rand()
{
return rand();
}

View File

@ -4,6 +4,7 @@
#include "behaviac/behaviac.h"
#include "behaviac_customized_types.h"
class Room;
class BaseAgent : public behaviac::Agent
{
public:
@ -16,4 +17,12 @@ public:
void Exec() {}
void SetOwner(Creature* owner) { }
bool IsGameOver();
int GetTickCount();
int RandRange(int min_val, int max_val);
int Rand();
public:
Room* room = nullptr;
};