coeng
annotate src/gameobj.h @ 4:49a2e70ac455
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 10 Feb 2015 17:21:30 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@1 | 1 #ifndef GAMEOBJECT_H_ |
nuclear@1 | 2 #define GAMEOBJECT_H_ |
nuclear@1 | 3 |
nuclear@1 | 4 #include <vector> |
nuclear@1 | 5 #include <map> |
nuclear@1 | 6 #include <string> |
nuclear@1 | 7 #include "comp.h" |
nuclear@1 | 8 |
nuclear@1 | 9 class GameObject { |
nuclear@1 | 10 private: |
nuclear@1 | 11 std::vector<Component*> comp; |
nuclear@1 | 12 std::map<std::string, Component*> comp_by_name; |
nuclear@1 | 13 |
nuclear@1 | 14 bool sorted; |
nuclear@1 | 15 |
nuclear@1 | 16 public: |
nuclear@1 | 17 GameObject(); |
nuclear@1 | 18 ~GameObject(); |
nuclear@1 | 19 |
nuclear@1 | 20 bool add_component(Component *c); // takes ownership |
nuclear@1 | 21 bool remove_component(Component *c); |
nuclear@1 | 22 bool delete_component(Component *c); |
nuclear@1 | 23 |
nuclear@1 | 24 Component *get_component(const char *name) const; |
nuclear@1 | 25 |
nuclear@1 | 26 void update(); |
nuclear@1 | 27 }; |
nuclear@1 | 28 |
nuclear@1 | 29 #endif // GAMEOBJECT_H_ |