39 lines
867 B
C++
39 lines
867 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, std::vector<Human*>* androids);
|
|
void RecycleAndroid(Human* hum);
|
|
Human* ActiveAndroid(Human* hum);
|
|
bool IsTimeOut() { return timeout_; };
|
|
int GetPveLeftTime();
|
|
void NextWave();
|
|
void ShowHand();
|
|
void Clear(int save_num);
|
|
|
|
private:
|
|
bool CanSee(Human* hum, Human* exclude_hum);
|
|
void AutoAllocAndroid();
|
|
void OnEnterNewWave(int wave);
|
|
void SpawnWaveMon(int wave);
|
|
void Rearrangement();
|
|
|
|
private:
|
|
int wait_alloc_time_ = 0;
|
|
bool timeout_ = false;
|
|
std::vector<Human*> hold_humans_;
|
|
a8::XTimerWp alloc_timer_;
|
|
std::vector<a8::XTimerWp> wave_timers_;
|
|
a8::Attacher xtimer_attacher_;
|
|
};
|