-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntity.h
More file actions
43 lines (30 loc) · 750 Bytes
/
Entity.h
File metadata and controls
43 lines (30 loc) · 750 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
43
#ifndef _ENTITY_H_
#define _ENTITY_H_
#include <map>
#include <typeindex>
#include "IComponent.h"
class IComponent;
class Entity
{
public:
Entity();
Entity(unsigned int ID);
~Entity();
void Update();
void AddComponent(IComponent* component, std::type_index type, bool replace = false);
void RemoveComponent(std::type_index type);
bool ComponentExists(std::type_index type);
IComponent* GetComponent(std::type_index type);
void SetID(unsigned int id);
unsigned int getID();
void SetName(std::string name);
std::string getName();
void SetTag(std::string tag);
std::string getTag();
private:
std::map<std::type_index, IComponent*> components;
unsigned int entityID;
std::string entityName;
std::string entityTag;
};
#endif