]> git.xonotic.org Git - xonotic/gmqcc.git/blob - data/fields.qc
entityfield tests
[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(entity a, .float f) printfield = {
16 //    print3("The field is ", ftos(a.f), "\n");
17 //};
18 void(entity x) foo = {
19     print2(ftos(x.mema),"\n");
20 };
21
22 void() main = {
23     entity pawn;
24
25     pawn = spawn();
26
27     pawn.mema = 9;
28     pawn.memv = '1 2 3';
29     pawn.memb = 10;
30
31     print3("x = ", ftos(pawn.memv_x), "\n");
32     print3("y = ", ftos(pawn.memv_y), "\n");
33     print3("z = ", ftos(pawn.memv_z), "\n");
34     print3("a = ", ftos(pawn.mema), "\n");
35     print3("b = ", ftos(pawn.memb), "\n");
36     pawn.memv_y += 3;
37     print3("x = ", ftos(pawn.memv_x), "\n");
38     print3("y = ", ftos(pawn.memv_y), "\n");
39     print3("z = ", ftos(pawn.memv_z), "\n");
40     foo(pawn);
41 };