game2006/server/gameserver/incubator.h
2022-12-13 19:17:46 +08:00

35 lines
743 B
C++

#pragma once
#include <a8/xtimer.h>
class Human;
class Room;
class Incubator
{
public:
Room* room = nullptr;
void Init();
void UnInit();
void InitPve();
void AllocAndroid(Human* target, int num);
void RecycleAndroid(Human* hum);
void ActiveAndroid(Human* hum, Human* android);
bool IsTimeOut() { return timeout_; };
int GetPveLeftTime();
void NextWave();
private:
bool CanSee(Human* hum, Human* exclude_hum);
void AutoAllocAndroid();
void OnEnterNewWave(int wave);
void SpawnWaveMon(int wave);
private:
bool timeout_ = false;
std::vector<Human*> hold_humans_;
a8::XTimerWp alloc_timer_;
std::vector<a8::XTimerWp> wave_timers_;
a8::Attacher xtimer_attacher_;
};