4 CLASS(GameItem, Object)
5 METHOD(GameItem, respondTo, bool(entity, int))
10 #define ITEM_SIGNALS(_) \
11 _(Default, void, (entity it), LAMBDA({ it.respondTo(it, SIGNAL); })) \
12 /* Common item signals */
14 #define ITEM_SIGNAL(id) __Item_Signal_##id
16 #define ITEM_ENUM(id, ret, params, body) ITEM_SIGNAL(id) ,
17 enum { ITEM_SIGNALS(ITEM_ENUM) };
20 #define ITEM_SEND(id, ret, params, body) ret __Item_Send_##id params { const noref int SIGNAL = ITEM_SIGNAL(id); body }
21 ITEM_SIGNALS(ITEM_SEND)
23 #define ITEM_SEND(id, ...) __Item_Send_##id(__VA_ARGS__)
28 #define REGISTER_ITEM(id, class, body) \
30 void RegisterItems_##id() { \
31 const noref entity this = NEW(class); \
33 ITEMS[ITEM_COUNT++] = this; \
36 ACCUMULATE_FUNCTION(RegisterItems, RegisterItems_##id)