Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
datasource.qc
Go to the documentation of this file.
1#include "datasource.qh"
2
3 CONSTRUCTOR(StringSource, string str, string sep)
4 {
6 this.StringSource_str = str;
7 this.StringSource_sep = sep;
8 }
9 METHOD(StringSource, getEntry, entity(entity this, int i, void(string name, string icon) returns))
10 {
11 int n = tokenizebyseparator(this.StringSource_str, this.StringSource_sep);
12 if (i < 0 || i >= n) return DataSource_false;
13 string s = argv(i);
14 if (returns) returns(s, string_null);
15 return DataSource_true;
16 }
17 METHOD(StringSource, reload, int(entity this, string filter))
18 {
19 return tokenizebyseparator(this.StringSource_str, this.StringSource_sep);
20 }
21
22 CONSTRUCTOR(CvarStringSource, string cv, string sep)
23 {
25 this.CvarStringSource_cvar = cv;
26 this.StringSource_sep = sep;
27 }
28 METHOD(CvarStringSource, getEntry, entity(entity this, int i, void(string name, string icon) returns))
29 {
30 string s = this.CvarStringSource_cvar;
31 this.StringSource_str = s ? cvar_string(s) : string_null;
32 return SUPER(CvarStringSource).getEntry(this, i, returns);
33 }
34 METHOD(CvarStringSource, reload, int(entity this, string filter))
35 {
36 string s = this.CvarStringSource_cvar;
37 this.StringSource_str = s ? cvar_string(s) : string_null;
38 return SUPER(CvarStringSource).reload(this, filter);
39 }
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
virtual void getEntry()
get entry i passing name and icon through returns if it is not null returns DataSource_false if out o...
Definition datasource.qc:28
CvarStringSource(string cv, string sep)
Definition datasource.qc:22
virtual void reload()
reload all entries matching filter returning how many matches were found
Definition datasource.qc:34
StringSource(string str, string sep)
Definition datasource.qc:3
virtual void getEntry()
get entry i passing name and icon through returns if it is not null returns DataSource_false if out o...
Definition datasource.qc:9
virtual void reload()
reload all entries matching filter returning how many matches were found
Definition datasource.qc:17
entity() spawn
#define tokenizebyseparator
string name
Definition menu.qh:30
const string cvar_string(string name)
string argv(float n)
string string_null
Definition nil.qh:9
#define SUPER(cname)
Definition oo.qh:231
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define CONSTRUCTOR(cname,...)
Definition oo.qh:213
#define CONSTRUCT(cname,...)
Definition oo.qh:123