Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
arraylist.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _AL_type__e()
#define _AL_type__f()
#define _AL_type__s()
#define AL_DELETE(this)
#define AL_EACH(this, T, cond, body)
#define AL_gete(this, idx)
#define AL_getf(this, idx)
#define AL_gets(this, idx)
#define AL_NEW(this, n, default, T)
#define AL_sete(this, idx, val)
#define AL_setf(this, idx, val)
#define AL_sets(this, idx, val)

Typedefs

using ArrayList = entity

Functions

int al_etof (entity e) = #512
entity al_ftoe (int i) = #459
string al_ftos (float f) = #26
float al_stof (string s) = #81

Variables

int al_buf
int al_len

Macro Definition Documentation

◆ _AL_type__e

#define _AL_type__e ( )
Value:
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback

Definition at line 53 of file arraylist.qh.

◆ _AL_type__f

#define _AL_type__f ( )
Value:
float

Definition at line 38 of file arraylist.qh.

◆ _AL_type__s

#define _AL_type__s ( )
Value:
string

Definition at line 23 of file arraylist.qh.

◆ AL_DELETE

#define AL_DELETE ( this)
Value:
MACRO_BEGIN \
buf_del(this.al_buf); \
delete(this); \
this = NULL; \
int al_buf
Definition arraylist.qh:4
#define MACRO_END
Definition macro.qh:7
#define NULL
Definition post.qh:14

Definition at line 17 of file arraylist.qh.

17#define AL_DELETE(this) MACRO_BEGIN \
18 buf_del(this.al_buf); \
19 delete(this); \
20 this = NULL; \
21MACRO_END

Referenced by SHUTDOWN().

◆ AL_EACH

#define AL_EACH ( this,
T,
cond,
body )
Value:
MACRO_BEGIN \
const noref ArrayList _al = this; \
for (int i = 0, n = _al.al_len; i < n; ++i) \
{ \
const noref _AL_type__##T() it = AL_get##T(_al, i); \
if (cond) \
LAMBDA(body) \
} \
MACRO_END
entity ArrayList
Definition arraylist.qh:3

Definition at line 57 of file arraylist.qh.

57#define AL_EACH(this, T, cond, body) MACRO_BEGIN \
58 const noref ArrayList _al = this; \
59 for (int i = 0, n = _al.al_len; i < n; ++i) \
60 { \
61 const noref _AL_type__##T() it = AL_get##T(_al, i); \
62 if (cond) \
63 LAMBDA(body) \
64 } \
65MACRO_END

◆ AL_gete

#define AL_gete ( this,
idx )
Value:
al_ftoe(AL_getf(this, idx))
entity al_ftoe(int i)
#define AL_getf(this, idx)
Definition arraylist.qh:39

Definition at line 54 of file arraylist.qh.

◆ AL_getf

#define AL_getf ( this,
idx )
Value:
al_stof(AL_gets(this, idx))
#define AL_gets(this, idx)
Definition arraylist.qh:24
float al_stof(string s)

Definition at line 39 of file arraylist.qh.

◆ AL_gets

#define AL_gets ( this,
idx )
Value:
bufstr_get(this.al_buf, idx)

Definition at line 24 of file arraylist.qh.

◆ AL_NEW

#define AL_NEW ( this,
n,
default,
T )
Value:
MACRO_BEGIN \
ArrayList _al = this = new_pure(ArrayList); \
_al.al_buf = buf_create(); \
for (int i = 0, _n = _al.al_len = n; i < _n; ++i) \
{ \
const _AL_type__##T() it = default; \
AL_set##T(this, i, it); \
} \
MACRO_END
#define buf_create
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:66

Definition at line 7 of file arraylist.qh.

7#define AL_NEW(this, n, default, T) MACRO_BEGIN \
8 ArrayList _al = this = new_pure(ArrayList); \
9 _al.al_buf = buf_create(); \
10 for (int i = 0, _n = _al.al_len = n; i < _n; ++i) \
11 { \
12 const _AL_type__##T() it = default; \
13 AL_set##T(this, i, it); \
14 } \
15MACRO_END

Referenced by STATIC_INIT().

◆ AL_sete

#define AL_sete ( this,
idx,
val )
Value:
AL_setf(this, idx, al_etof(val))
int al_etof(entity e)
#define AL_setf(this, idx, val)
Definition arraylist.qh:40

Definition at line 55 of file arraylist.qh.

◆ AL_setf

#define AL_setf ( this,
idx,
val )
Value:
AL_sets(this, idx, al_ftos(val))
string al_ftos(float f)
#define AL_sets(this, idx, val)
Definition arraylist.qh:25

Definition at line 40 of file arraylist.qh.

◆ AL_sets

#define AL_sets ( this,
idx,
val )
Value:
bufstr_set(this.al_buf, idx, val)

Definition at line 25 of file arraylist.qh.

Typedef Documentation

◆ ArrayList

using ArrayList = entity

Definition at line 3 of file arraylist.qh.

Function Documentation

◆ al_etof()

int al_etof ( entity e) = #512

References entity().

◆ al_ftoe()

entity al_ftoe ( int i) = #459

References entity().

◆ al_ftos()

string al_ftos ( float f) = #26

◆ al_stof()

float al_stof ( string s) = #81

Variable Documentation

◆ al_buf

int al_buf

Definition at line 4 of file arraylist.qh.

◆ al_len

int al_len

Definition at line 5 of file arraylist.qh.