coeng

annotate 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
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_