2015-12-04 04:30:54 +00:00
|
|
|
// Example IDL file for our monster's schema.
|
2014-01-28 00:52:49 +00:00
|
|
|
|
|
|
|
namespace MyGame.Sample;
|
|
|
|
|
|
|
|
enum Color:byte { Red = 0, Green, Blue = 2 }
|
|
|
|
|
2015-12-04 04:30:54 +00:00
|
|
|
union Equipment { Weapon } // Optionally add more tables.
|
2014-01-28 00:52:49 +00:00
|
|
|
|
|
|
|
struct Vec3 {
|
|
|
|
x:float;
|
|
|
|
y:float;
|
|
|
|
z:float;
|
|
|
|
}
|
|
|
|
|
|
|
|
table Monster {
|
|
|
|
pos:Vec3;
|
|
|
|
mana:short = 150;
|
|
|
|
hp:short = 100;
|
|
|
|
name:string;
|
|
|
|
friendly:bool = false (deprecated);
|
|
|
|
inventory:[ubyte];
|
|
|
|
color:Color = Blue;
|
2015-12-04 04:30:54 +00:00
|
|
|
weapons:[Weapon];
|
|
|
|
equipped:Equipment;
|
|
|
|
}
|
|
|
|
|
|
|
|
table Weapon {
|
|
|
|
name:string;
|
|
|
|
damage:short;
|
2014-01-28 00:52:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
root_type Monster;
|