-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEntityManager.hpp
More file actions
51 lines (38 loc) · 1.23 KB
/
Copy pathEntityManager.hpp
File metadata and controls
51 lines (38 loc) · 1.23 KB
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
#pragma once
//---------------------------------------------------------------------------------
// Written by Terence J. Grant - tjgrant [at] tatewake [dot] com
// Find the full tutorial at: http://gamedev.tutsplus.com/series/
//----------------------------------------------------------------------------------
class Bullet;
class Enemy;
class BlackHole;
class EntityManager
: public tSingleton<EntityManager>
{
protected:
std::list<Entity*> mEntities;
std::list<Enemy*> mEnemies;
std::vector<Entity*> mAddedEntities;
std::list<Bullet*> mBullets;
std::list<BlackHole*> mBlackHoles;
bool mIsUpdating;
protected:
void KillPlayer();
protected:
EntityManager();
public:
int getCount() const;
int getBlackHoleCount() const;
std::list<BlackHole*> getBlackHoles() const;
void add(Entity* entity);
void addEntity(Entity* entity);
void deleteEntity(Entity* entity);
void CleanUp();
void update();
void draw(tSpriteBatch* spriteBatch);
void handleCollisions();
bool isColliding(Entity* a, Entity* b);
std::list<Entity*> getNearbyEntities(const tPoint2f& pos, float radius);
friend class tSingleton<EntityManager>;
friend class ParticleState;
};