]> git.xonotic.org Git - xonotic/gmqcc.git/blob - data/fields.qc
cache the IMMEDIATE string in the builder directly
[xonotic/gmqcc.git] / data / fields.qc
1 /* this is the WIP test for the parser...
2  * constantly adding stuff here to see if things break
3  */
4 void(string)        print  = #1;
5 void(string,string) print2 = #1;
6 void(string,string,string) print3 = #1;
7 string(float)       ftos   = #2;
8 entity()            spawn  = #3;
9 void(entity)        kill   = #4;
10
11 .float mema;
12 .float memb;
13 .vector memv;
14
15 .void() fun;
16
17 void(entity a, .float f) printfield = {
18     print3("The field is ", ftos(a.f), "\n");
19 };
20
21 void() funny = {
22     print("FUNNY\n");
23 };
24
25 void() main = {
26     local entity pawn;
27
28     pawn = spawn();
29
30     pawn.mema = 9;
31     pawn.memv = '1 2 3';
32     pawn.memb = 10;
33
34     print3("x = ", ftos(pawn.memv_x), "\n");
35     print3("y = ", ftos(pawn.memv_y), "\n");
36     print3("z = ", ftos(pawn.memv_z), "\n");
37     print3("a = ", ftos(pawn.mema), "\n");
38     print3("b = ", ftos(pawn.memb), "\n");
39     pawn.memv_y += 3;
40     print3("x = ", ftos(pawn.memv_x), "\n");
41     print3("y = ", ftos(pawn.memv_y), "\n");
42     print3("z = ", ftos(pawn.memv_z), "\n");
43     printfield(pawn, memv_z);
44
45     pawn.fun = funny;
46
47     pawn.fun();
48 };