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) void Incubator::RecycleAndroid(Human* hum)
{ {
Human* nearest_hum = nullptr; Human* nearest_hum = nullptr;
@ -31,18 +36,17 @@ void Incubator::RecycleAndroid(Human* hum)
} }
return true; return true;
}); });
if (hum->dead) {
hum->RemoveBuffByEffectId(kBET_BeRecycle);
return;
}
if (distance < 450) { if (distance < 450) {
hum->RemoveBuffByEffectId(kBET_BeRecycle); hum->RemoveBuffByEffectId(kBET_BeRecycle);
return; return;
} }
if (distance > 1450) { if (distance > 1450) {
hum->RemoveBuffByEffectId(kBET_BeRecycle); hum->RemoveBuffByEffectId(kBET_BeRecycle);
AddHoldHuman(nearest_hum); hold_humans_.insert(hum);
return; return;
} }
} }
void Incubator::AddHoldHuman(Human* hum)
{
hold_humans_.insert(hum);
}

View File

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