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)
entity al_ftoe (int i)
string al_ftos (float f)
float al_stof (string s)

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 55 of file arraylist.qh.

◆ _AL_type__f

#define _AL_type__f ( )
Value:
float

Definition at line 40 of file arraylist.qh.

◆ _AL_type__s

#define _AL_type__s ( )
Value:
string

Definition at line 25 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 18 of file arraylist.qh.

18#define AL_DELETE(this) \
19 MACRO_BEGIN \
20 buf_del(this.al_buf); \
21 delete(this); \
22 this = NULL; \
23 MACRO_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) { body } \
} \
MACRO_END
entity ArrayList
Definition arraylist.qh:3

Definition at line 59 of file arraylist.qh.

59#define AL_EACH(this, T, cond, body) \
60 MACRO_BEGIN \
61 const noref ArrayList _al = this; \
62 for (int i = 0, n = _al.al_len; i < n; ++i) \
63 { \
64 const noref _AL_type__##T() it = AL_get##T(_al, i); \
65 if (cond) { body } \
66 } \
67 MACRO_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:41

Definition at line 56 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:26
float al_stof(string s)

Definition at line 41 of file arraylist.qh.

◆ AL_gets

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

Definition at line 26 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:67

Definition at line 7 of file arraylist.qh.

7#define AL_NEW(this, n, default, T) \
8 MACRO_BEGIN \
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) \
12 { \
13 const _AL_type__##T() it = default; \
14 AL_set##T(this, i, it); \
15 } \
16 MACRO_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:42

Definition at line 57 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:27

Definition at line 42 of file arraylist.qh.

◆ AL_sets

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

Definition at line 27 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)

References entity().

◆ al_ftoe()

entity al_ftoe ( int i)

References entity().

◆ al_ftos()

string al_ftos ( float f)

◆ al_stof()

float al_stof ( string s)

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.