mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-24 12:51:04 +00:00
entityfield tests
This commit is contained in:
parent
9f951e36a9
commit
1bc6d10898
1 changed files with 41 additions and 0 deletions
41
data/fields.qc
Normal file
41
data/fields.qc
Normal file
|
@ -0,0 +1,41 @@
|
|||
/* this is the WIP test for the parser...
|
||||
* constantly adding stuff here to see if things break
|
||||
*/
|
||||
void(string) print = #1;
|
||||
void(string,string) print2 = #1;
|
||||
void(string,string,string) print3 = #1;
|
||||
string(float) ftos = #2;
|
||||
entity() spawn = #3;
|
||||
void(entity) kill = #4;
|
||||
|
||||
.float mema;
|
||||
.float memb;
|
||||
.vector memv;
|
||||
|
||||
//void(entity a, .float f) printfield = {
|
||||
// print3("The field is ", ftos(a.f), "\n");
|
||||
//};
|
||||
void(entity x) foo = {
|
||||
print2(ftos(x.mema),"\n");
|
||||
};
|
||||
|
||||
void() main = {
|
||||
entity pawn;
|
||||
|
||||
pawn = spawn();
|
||||
|
||||
pawn.mema = 9;
|
||||
pawn.memv = '1 2 3';
|
||||
pawn.memb = 10;
|
||||
|
||||
print3("x = ", ftos(pawn.memv_x), "\n");
|
||||
print3("y = ", ftos(pawn.memv_y), "\n");
|
||||
print3("z = ", ftos(pawn.memv_z), "\n");
|
||||
print3("a = ", ftos(pawn.mema), "\n");
|
||||
print3("b = ", ftos(pawn.memb), "\n");
|
||||
pawn.memv_y += 3;
|
||||
print3("x = ", ftos(pawn.memv_x), "\n");
|
||||
print3("y = ", ftos(pawn.memv_y), "\n");
|
||||
print3("z = ", ftos(pawn.memv_z), "\n");
|
||||
foo(pawn);
|
||||
};
|
Loading…
Reference in a new issue