2014-01-28 00:52:49 +00:00
|
|
|
// example IDL file
|
|
|
|
|
|
|
|
namespace MyGame.Example;
|
|
|
|
|
|
|
|
enum Color:byte { Red = 0, Green, Blue = 2 }
|
|
|
|
|
|
|
|
union Any { Monster } // TODO: add more elements
|
|
|
|
|
|
|
|
struct Test { a:short; b:byte; }
|
|
|
|
|
|
|
|
struct Vec3 (force_align: 16) {
|
|
|
|
x:float;
|
|
|
|
y:float;
|
|
|
|
z:float;
|
|
|
|
test1:double;
|
|
|
|
test2:byte;
|
|
|
|
test3:Test;
|
|
|
|
}
|
|
|
|
|
|
|
|
table Monster {
|
|
|
|
pos:Vec3;
|
|
|
|
mana:short = 150;
|
|
|
|
hp:short = 100;
|
|
|
|
name:string;
|
|
|
|
friendly:bool = false (deprecated, priority: 1);
|
|
|
|
inventory:[ubyte];
|
|
|
|
/// an example documentation comment: this will end up in the generated code
|
|
|
|
/// multiline too
|
|
|
|
color:Color = Blue;
|
|
|
|
test:Any;
|
|
|
|
test4:[Test];
|
2014-06-27 23:44:53 +00:00
|
|
|
testarrayofstring:[string];
|
|
|
|
testarrayoftables:[Monster];
|
2014-01-28 00:52:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
root_type Monster;
|