coeng
diff src/gameobj.h @ 1:b0d8d454c546
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 05 Feb 2015 00:38:59 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/gameobj.h Thu Feb 05 00:38:59 2015 +0200 1.3 @@ -0,0 +1,29 @@ 1.4 +#ifndef GAMEOBJECT_H_ 1.5 +#define GAMEOBJECT_H_ 1.6 + 1.7 +#include <vector> 1.8 +#include <map> 1.9 +#include <string> 1.10 +#include "comp.h" 1.11 + 1.12 +class GameObject { 1.13 +private: 1.14 + std::vector<Component*> comp; 1.15 + std::map<std::string, Component*> comp_by_name; 1.16 + 1.17 + bool sorted; 1.18 + 1.19 +public: 1.20 + GameObject(); 1.21 + ~GameObject(); 1.22 + 1.23 + bool add_component(Component *c); // takes ownership 1.24 + bool remove_component(Component *c); 1.25 + bool delete_component(Component *c); 1.26 + 1.27 + Component *get_component(const char *name) const; 1.28 + 1.29 + void update(); 1.30 +}; 1.31 + 1.32 +#endif // GAMEOBJECT_H_