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