#define REGISTER(initfunc, ns, array, counter, id, class, fld) \
entity ns##_##id; \
REGISTER_INIT(ns, id) { } \
+ .entity enemy; /* internal next pointer */ \
void Register_##ns##_##id() { \
entity this = NEW(class); \
ns##_##id = this; \
this.fld = counter; \
array[counter++] = this; \
+ if (!array##_first) array##_first = this; \
+ if ( array##_last) array##_last.enemy = this; \
+ array##_last = this; \
Register_##ns##_##id##_init(this); \
} \
ACCUMULATE_FUNCTION(initfunc, Register_##ns##_##id) \