4 #define ITEM_HANDLE(signal, ...) __Item_Send_##signal(__VA_ARGS__)
5 CLASS(GameItem, Object)
6 ATTRIB(GameItem, m_id, int, 0)
7 METHOD(GameItem, show, void(entity this))
8 void GameItem_show(entity this) { print("A game item\n"); }
9 void ITEM_HANDLE(Show, entity this) { this.show(this); }
14 /** If you register a new item, make sure to add it to all.inc */
15 #define REGISTER_ITEM(id, class, body) \
17 void RegisterItems_init_##id(entity this) { body } \
18 void RegisterItems_##id() { \
19 entity this = NEW(class); \
21 this.m_id = ITEM_COUNT; \
22 ITEMS[ITEM_COUNT++] = this; \
23 RegisterItems_init_##id(this); \
25 ACCUMULATE_FUNCTION(RegisterItems, RegisterItems_##id) \
26 [[accumulate]] void RegisterItems_init_##id(entity this)