1
This commit is contained in:
parent
a35831d7c8
commit
f1d8c8e37a
@ -329,6 +329,7 @@ behaviac::EBTStatus HeroAgent::SearchEnemy(float range)
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
return behaviac::BT_RUNNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
behaviac::EBTStatus HeroAgent::CoIdle(int min_val, int max_val)
|
behaviac::EBTStatus HeroAgent::CoIdle(int min_val, int max_val)
|
||||||
|
@ -1213,9 +1213,6 @@ Team* Room::NewTeam()
|
|||||||
|
|
||||||
void Room::TraversePlayerList(std::function<void (Player*)> func)
|
void Room::TraversePlayerList(std::function<void (Player*)> func)
|
||||||
{
|
{
|
||||||
if (!func) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (auto& pair : accountid_hash_) {
|
for (auto& pair : accountid_hash_) {
|
||||||
if (pair.second) {
|
if (pair.second) {
|
||||||
func(pair.second);
|
func(pair.second);
|
||||||
@ -1225,9 +1222,6 @@ void Room::TraversePlayerList(std::function<void (Player*)> func)
|
|||||||
|
|
||||||
void Room::TraverseHumanList(std::function<bool (Human*)> func)
|
void Room::TraverseHumanList(std::function<bool (Human*)> func)
|
||||||
{
|
{
|
||||||
if (!func) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (auto& pair : human_hash_) {
|
for (auto& pair : human_hash_) {
|
||||||
if (pair.second) {
|
if (pair.second) {
|
||||||
if (!func(pair.second)) {
|
if (!func(pair.second)) {
|
||||||
@ -1237,11 +1231,19 @@ void Room::TraverseHumanList(std::function<bool (Human*)> func)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Room::TraverseAliveHumanList(std::function<bool (Human*)> func)
|
||||||
|
{
|
||||||
|
for (auto& pair : alive_human_hash_) {
|
||||||
|
if (pair.second) {
|
||||||
|
if (!func(pair.second)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Room::TraverseEntityList(std::function<bool (Entity*)> func)
|
void Room::TraverseEntityList(std::function<bool (Entity*)> func)
|
||||||
{
|
{
|
||||||
if (!func) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (auto& pair : uniid_hash_) {
|
for (auto& pair : uniid_hash_) {
|
||||||
if (pair.second) {
|
if (pair.second) {
|
||||||
if (!func(pair.second)) {
|
if (!func(pair.second)) {
|
||||||
|
@ -156,6 +156,7 @@ public:
|
|||||||
|
|
||||||
void TraversePlayerList(std::function<void (Player*)> func);
|
void TraversePlayerList(std::function<void (Player*)> func);
|
||||||
void TraverseHumanList(std::function<bool (Human*)> func);
|
void TraverseHumanList(std::function<bool (Human*)> func);
|
||||||
|
void TraverseAliveHumanList(std::function<bool (Human*)> func);
|
||||||
void TraverseEntityList(std::function<bool (Entity*)> func);
|
void TraverseEntityList(std::function<bool (Entity*)> func);
|
||||||
void TraverseAlivePlayers(std::function<bool (Human*)> func);
|
void TraverseAlivePlayers(std::function<bool (Human*)> func);
|
||||||
void BroadcastDebugMsg(const std::string& debug_msg);
|
void BroadcastDebugMsg(const std::string& debug_msg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user