4 [[alias("self")]] entity __self;
6 // Step 1: auto oldself
8 #define SELFPARAM() noref entity this = __self
10 #define SELFCALL(s, f) (__self = s, f)
11 #define SELFCALL_DONE() (__self = this)
14 // Step 2: check SELFPARAM() is present for functions that use self
16 #define SELFPARAM() [[alias("__self")]] noref entity this = __self
18 #define SELFCALL(s, f) (this = s, f)
19 #define SELFCALL_DONE() (this = this)
24 #define SELFPARAM() noref const entity this = __self
25 entity setself(entity e) { return self = e; }
26 entity getself() { return self; }
27 #define self getself()
28 #define SELFCALL(s, f) (__self = s, f)
29 #define SELFCALL_DONE() (__self = this)
32 // Step 4: enable when possible
34 #define SELFPARAM() noref const entity this = __self
36 #define SELFCALL(s, f) (__self = s, f)
37 #define SELFCALL_DONE() (__self = this)
40 #define spawn() new(entity)