3 USING(ArrayList, entity);
7 #define AL_NEW(this, n, default, T) \
9 ArrayList _al = this = new_pure(ArrayList); \
10 _al.al_buf = buf_create(); \
11 for (int i = 0, _n = _al.al_len = n; i < _n; ++i) \
13 const _AL_type__##T() it = default; \
14 AL_set##T(this, i, it); \
18 #define AL_DELETE(this) \
20 buf_del(this.al_buf); \
25 #define _AL_type__s() string
26 #define AL_gets(this, idx) bufstr_get(this.al_buf, idx)
27 #define AL_sets(this, idx, val) bufstr_set(this.al_buf, idx, val)
30 string al_ftos(float f) = #26;
31 float al_stof(string s) = #81;
33 string al_ftos(float f) = #26;
34 float al_stof(string s) = #81;
36 string al_ftos(float f) = #17;
37 float al_stof(string s) = #21;
40 #define _AL_type__f() float
41 #define AL_getf(this, idx) al_stof(AL_gets(this, idx))
42 #define AL_setf(this, idx, val) AL_sets(this, idx, al_ftos(val))
45 int al_etof(entity e) = #512;
46 entity al_ftoe(int i) = #459;
48 int al_etof(entity e) = #512;
49 entity al_ftoe(int i) = #459;
51 int al_etof(entity e) = #79;
52 entity al_ftoe(int i) = #80;
55 #define _AL_type__e() entity
56 #define AL_gete(this, idx) al_ftoe(AL_getf(this, idx))
57 #define AL_sete(this, idx, val) AL_setf(this, idx, al_etof(val))
59 #define AL_EACH(this, T, cond, body) \
61 const noref ArrayList _al = this; \
62 for (int i = 0, n = _al.al_len; i < n; ++i) \
64 const noref _AL_type__##T() it = AL_get##T(_al, i); \