coeng

view 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
line source
1 #ifndef COMP_H_
2 #define COMP_H_
4 #include <string>
6 class GameObject;
8 class Component {
9 protected:
10 const char *name;
11 GameObject *gobj;
12 int upd_prio; // update priority (0: normal)
14 public:
15 Component();
16 virtual ~Component();
18 const char *get_name() const;
20 virtual void update();
22 bool operator <(const Component &c) const; // for sorting based on priority
24 friend class GameObject;
25 };
27 void register_component(const char *name, Component *(*cons_func)());
28 Component *create_component(const char *name);
30 #endif // COMP_H_