coeng
annotate src/comp.h @ 2:4a1c9597f4d3
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 05 Feb 2015 11:04:07 +0200 |
parents | b0d8d454c546 |
children | 2f872a179914 |
rev | line source |
---|---|
nuclear@0 | 1 #ifndef COMP_H_ |
nuclear@0 | 2 #define COMP_H_ |
nuclear@0 | 3 |
nuclear@1 | 4 #include <string> |
nuclear@0 | 5 |
nuclear@1 | 6 class GameObject; |
nuclear@1 | 7 |
nuclear@0 | 8 class Component { |
nuclear@1 | 9 protected: |
nuclear@2 | 10 const char *name; |
nuclear@2 | 11 GameObject *gobj; |
nuclear@1 | 12 int upd_prio; // update priority (0: normal) |
nuclear@1 | 13 |
nuclear@0 | 14 public: |
nuclear@2 | 15 Component(); |
nuclear@2 | 16 virtual ~Component(); |
nuclear@1 | 17 |
nuclear@1 | 18 const char *get_name() const; |
nuclear@1 | 19 |
nuclear@1 | 20 virtual void update(); |
nuclear@1 | 21 |
nuclear@1 | 22 bool operator <(const Component &c) const; // for sorting based on priority |
nuclear@2 | 23 |
nuclear@2 | 24 friend class GameObject; |
nuclear@1 | 25 }; |
nuclear@1 | 26 |
nuclear@2 | 27 void register_component(const char *name, Component *(*cons_func)()); |
nuclear@2 | 28 Component *create_component(const char *name); |
nuclear@0 | 29 |
nuclear@0 | 30 #endif // COMP_H_ |