-
Notifications
You must be signed in to change notification settings - Fork 0
/
zombiemanager.hh
61 lines (37 loc) · 1.2 KB
/
zombiemanager.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef ZOMBIEMANAGER_HH
#define ZOMBIEMANAGER_HH
#include <list>
#include <ClanLib/sound.h>
#include <ClanLib/vorbis.h>
//#include "itemmanager.hh"
#include "zombie.hh"
#include "map.hh"
class ZombieManager
{
public:
~ZombieManager();
static ZombieManager& instance();
void init(Player* newplayer, CL_ResourceManager& rm);
void moveZombies(double dt, Player* player, Map* map);
void drawZombies(CL_GraphicContext gc, const Player& player);
void spawnZombies(double dt, CL_ResourceManager& rm, CL_GraphicContext gc); // TODO: fix spawner so that zombies spawn in waves and over time.
std::list<Zombie>* getZombies(); //TODO Should be const.....
std::list<Zombie>::iterator removeZombie(std::list<Zombie>::iterator zombie);
bool collides(std::list<Zombie>::iterator zombie, Map* map);
Player* getPlayer()
{return player;}
bool isNearWall(std::list<Zombie>::iterator zombie, Map* map);
void clearZombies();
int** createMovementMap(Player* player, Map* map);
private:
static ZombieManager object;
std::list<Zombie> zombies;
double spawnTime;
size_t amount;
Player* player;
size_t timeSinceLastBite;
CL_SoundBuffer* zombieWave;
CL_ResourceManager rm;
ZombieManager();
};
#endif