This commit is contained in:
aozhiwei 2021-04-13 13:54:28 +08:00
parent 00cea231a5
commit af7e06aea8
2 changed files with 11 additions and 7 deletions

View File

@ -14,6 +14,11 @@ void Incubator::UnInit()
}
void Incubator::AllocAndroid(Human* target, int num)
{
}
void Incubator::RecycleAndroid(Human* hum)
{
Human* nearest_hum = nullptr;
@ -31,18 +36,17 @@ void Incubator::RecycleAndroid(Human* hum)
}
return true;
});
if (hum->dead) {
hum->RemoveBuffByEffectId(kBET_BeRecycle);
return;
}
if (distance < 450) {
hum->RemoveBuffByEffectId(kBET_BeRecycle);
return;
}
if (distance > 1450) {
hum->RemoveBuffByEffectId(kBET_BeRecycle);
AddHoldHuman(nearest_hum);
hold_humans_.insert(hum);
return;
}
}
void Incubator::AddHoldHuman(Human* hum)
{
hold_humans_.insert(hum);
}

View File

@ -9,10 +9,10 @@ class Incubator
void Init();
void UnInit();
void AllocAndroid(Human* target, int num);
void RecycleAndroid(Human* hum);
private:
void AddHoldHuman(Human* hum);
private:
std::set<Human*> hold_humans_;