-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentitylist.h
More file actions
42 lines (34 loc) · 790 Bytes
/
Copy pathentitylist.h
File metadata and controls
42 lines (34 loc) · 790 Bytes
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
/*
* entitylist.h
*
* Created on: 2013-07-17
* Author: Liam
*/
#ifndef ENTITYLIST_H_
#define ENTITYLIST_H_
#include "entity.h"
typedef struct EntityNode {
Entity *data;
EntityNode *next;
EntityNode *prev;
} LL_EntityNode;
typedef class EntityList {
public:
EntityList():m_head(NULL), m_tail(NULL), m_numOfEntities(0) {}
EntityList(const EntityList &src);
EntityList &operator=(const EntityList &src);
~EntityList();
void add(Entity *data);
void remove(const Entity &data);
void clear();
Entity *getByIndex(int i);
int getNumOfEntities() {return m_numOfEntities;}
private:
void destroy();
void copy(const EntityList &src);
EntityNode *m_head;
EntityNode *m_tail;
int m_numOfEntities;
} LL_Entity;
extern EntityList g_Entities;
#endif /* ENTITYLIST_H_ */