1
This commit is contained in:
parent
6e191ce542
commit
f3da219517
@ -115,7 +115,7 @@ behaviac::EBTStatus AndroidAgent::DoAttack()
|
|||||||
if (status_ == behaviac::BT_RUNNING) {
|
if (status_ == behaviac::BT_RUNNING) {
|
||||||
return status_runing_cb_();
|
return status_runing_cb_();
|
||||||
}
|
}
|
||||||
Human* enemy = GetOwner()->room->FindEnemy(GetOwner());
|
Human* enemy = GetOwner()->room->FindEnemy(GetOwner()->AsHuman());
|
||||||
if (!enemy) {
|
if (!enemy) {
|
||||||
return behaviac::BT_FAILURE;
|
return behaviac::BT_FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -19,10 +19,6 @@ public:
|
|||||||
behaviac::EBTStatus DoRandomShot();
|
behaviac::EBTStatus DoRandomShot();
|
||||||
behaviac::EBTStatus DoAttack();
|
behaviac::EBTStatus DoAttack();
|
||||||
|
|
||||||
public:
|
|
||||||
void SetOwner(Android* owner) { owner_ = owner; };
|
|
||||||
Android* GetOwner() { return owner_; };
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Android* owner_ = nullptr;
|
Android* owner_ = nullptr;
|
||||||
};
|
};
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "behaviac/behaviac.h"
|
#include "behaviac/behaviac.h"
|
||||||
#include "behaviac_customized_types.h"
|
#include "behaviac_customized_types.h"
|
||||||
|
|
||||||
|
class Creature;
|
||||||
class BaseAgent : public behaviac::Agent
|
class BaseAgent : public behaviac::Agent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -14,7 +15,14 @@ public:
|
|||||||
|
|
||||||
bool IsGameOver();
|
bool IsGameOver();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void SetOwner(Creature* owner) { owner_ = owner; };
|
||||||
|
Creature* GetOwner() { return owner_; };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
behaviac::EBTStatus status_= behaviac::BT_SUCCESS;
|
behaviac::EBTStatus status_= behaviac::BT_SUCCESS;
|
||||||
std::function<behaviac::EBTStatus()> status_runing_cb_;
|
std::function<behaviac::EBTStatus()> status_runing_cb_;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Creature* owner_ = nullptr;
|
||||||
};
|
};
|
||||||
|
2
third_party/framework
vendored
2
third_party/framework
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 88464b5a593f82ea8ff0f5698433bff9ae935518
|
Subproject commit 1dbae08b6f5d9e4df8325f5170a2355953ff4db8
|
Loading…
x
Reference in New Issue
Block a user