coeng

view src/gobj.h @ 5:0e5da17d589c

decided to really work on this, so first a slight rename
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 14 Feb 2015 01:35:42 +0200
parents src/gameobj.h@b0d8d454c546
children 2f872a179914
line source
1 #ifndef GAMEOBJECT_H_
2 #define GAMEOBJECT_H_
4 #include <vector>
5 #include <map>
6 #include <string>
7 #include "comp.h"
9 class GameObject {
10 private:
11 std::vector<Component*> comp;
12 std::map<std::string, Component*> comp_by_name;
14 bool sorted;
16 public:
17 GameObject();
18 ~GameObject();
20 bool add_component(Component *c); // takes ownership
21 bool remove_component(Component *c);
22 bool delete_component(Component *c);
24 Component *get_component(const char *name) const;
26 void update();
27 };
29 #endif // GAMEOBJECT_H_