nuclear@0: #ifndef COMP_H_ nuclear@0: #define COMP_H_ nuclear@0: nuclear@1: #include nuclear@0: nuclear@1: class GameObject; nuclear@1: nuclear@0: class Component { nuclear@1: protected: nuclear@2: const char *name; nuclear@2: GameObject *gobj; nuclear@1: int upd_prio; // update priority (0: normal) nuclear@1: nuclear@0: public: nuclear@2: Component(); nuclear@2: virtual ~Component(); nuclear@1: nuclear@1: const char *get_name() const; nuclear@1: nuclear@1: virtual void update(); nuclear@1: nuclear@1: bool operator <(const Component &c) const; // for sorting based on priority nuclear@2: nuclear@2: friend class GameObject; nuclear@1: }; nuclear@1: nuclear@2: void register_component(const char *name, Component *(*cons_func)()); nuclear@2: Component *create_component(const char *name); nuclear@0: nuclear@0: #endif // COMP_H_