1 # Xonotic entity component system
7 * avoid declaring entity fields outside of components
8 * uncrustify relentlessly
9 * shared code in $file, prog specific code uses prefix: { client: cl_, server: sv_, menu: ui_ }. $file must exist
10 * component naming =~ com_$component_$name
11 * system naming =~ sys_$system_$name
12 * event naming =~ evt_$component_$name
13 * global naming =~ g_$name
14 * cvar naming =~ xon_$name
18 COMPONENT($component);
19 .int com_$component_$property;
24 e.com_$component = true;
25 e.com_$component_$property = 42;
29 SYSTEM($system, 30, 10);
30 sys_$system_update(entity this, float dt) {
38 EVENT($component_$name, (entity this));
46 entity listener = new_pure(someListener);
47 subscribe(listener, $event, void(entity this) { code; });