2012-08-16 14:29:41 +00:00
|
|
|
/* 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;
|
|
|
|
|
2012-08-18 12:50:30 +00:00
|
|
|
.void() fun;
|
|
|
|
|
2012-08-16 14:39:43 +00:00
|
|
|
void(entity a, .float f) printfield = {
|
|
|
|
print3("The field is ", ftos(a.f), "\n");
|
2012-08-16 14:29:41 +00:00
|
|
|
};
|
|
|
|
|
2012-08-18 12:50:30 +00:00
|
|
|
void() funny = {
|
|
|
|
print("FUNNY\n");
|
|
|
|
};
|
|
|
|
|
2012-08-16 14:29:41 +00:00
|
|
|
void() main = {
|
2012-08-18 12:56:15 +00:00
|
|
|
local entity pawn;
|
2012-08-16 14:29:41 +00:00
|
|
|
|
|
|
|
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");
|
2012-08-16 14:39:43 +00:00
|
|
|
printfield(pawn, memv_z);
|
2012-08-18 12:50:30 +00:00
|
|
|
|
|
|
|
pawn.fun = funny;
|
|
|
|
|
2012-08-18 13:25:45 +00:00
|
|
|
pawn.fun();
|
2012-08-16 14:29:41 +00:00
|
|
|
};
|