3 USING(ArrayList, entity);
7 #define AL_NEW(this, n, default, T) \
10 ArrayList _al = this = new_pure(ArrayList); \
11 _al.al_buf = buf_create(); \
12 for (int i = 0, _n = _al.al_len = n; i < _n; ++i) \
14 const _AL_type__##T() it = default; \
15 AL_set##T(this, i, it); \
19 #define AL_DELETE(this) \
22 buf_del(this.al_buf); \
27 #define _AL_type__s() string
28 #define AL_gets(this, idx) bufstr_get(this.al_buf, idx)
29 #define AL_sets(this, idx, val) bufstr_set(this.al_buf, idx, val)
32 string al_ftos(float f) = #26;
33 float al_stof(string s) = #81;
35 string al_ftos(float f) = #26;
36 float al_stof(string s) = #81;
38 string al_ftos(float f) = #17;
39 float al_stof(string s) = #21;
42 #define _AL_type__f() float
43 #define AL_getf(this, idx) al_stof(AL_gets(this, idx))
44 #define AL_setf(this, idx, val) AL_sets(this, idx, al_ftos(val))
47 int al_etof(entity e) = #512;
48 entity al_ftoe(int i) = #459;
50 int al_etof(entity e) = #512;
51 entity al_ftoe(int i) = #459;
53 int al_etof(entity e) = #79;
54 entity al_ftoe(int i) = #80;
57 #define _AL_type__e() entity
58 #define AL_gete(this, idx) al_ftoe(AL_getf(this, idx))
59 #define AL_sete(this, idx, val) AL_setf(this, idx, al_etof(val))
61 #define AL_EACH(this, T, cond, body) \
64 const noref ArrayList _al = this; \
65 for (int i = 0, n = _al.al_len; i < n; ++i) \
67 const noref _AL_type__##T() it = AL_get##T(_al, i); \