nuclear@6: #ifndef GOBJECT_H_ nuclear@6: #define GOBJECT_H_ nuclear@1: nuclear@1: #include nuclear@1: #include nuclear@1: #include nuclear@1: #include "comp.h" nuclear@1: nuclear@6: class GObject { nuclear@1: private: nuclear@1: std::vector comp; nuclear@1: std::map comp_by_name; nuclear@1: nuclear@1: bool sorted; nuclear@1: nuclear@6: void sort_components(); nuclear@6: nuclear@1: public: nuclear@6: GObject(); nuclear@6: ~GObject(); nuclear@1: nuclear@6: bool add_component(Component *c); // takes ownership nuclear@6: bool remove_component(Component *c); // whoever calls this, now has ownership nuclear@1: bool delete_component(Component *c); nuclear@1: nuclear@1: Component *get_component(const char *name) const; nuclear@1: nuclear@6: void update(float dt = 0.0f); nuclear@6: void draw() const; nuclear@1: }; nuclear@1: nuclear@6: #endif // GOBJECT_H_