Home | History | Annotate | Download | only in samples
      1 // Example IDL file for our monster's schema.
      2 
      3 namespace MyGame.Sample;
      4 
      5 enum Color:byte { Red = 0, Green, Blue = 2 }
      6 
      7 union Equipment { Weapon } // Optionally add more tables.
      8 
      9 struct Vec3 {
     10   x:float;
     11   y:float;
     12   z:float;
     13 }
     14 
     15 table Monster {
     16   pos:Vec3;
     17   mana:short = 150;
     18   hp:short = 100;
     19   name:string;
     20   friendly:bool = false (deprecated);
     21   inventory:[ubyte];
     22   color:Color = Blue;
     23   weapons:[Weapon];
     24   equipped:Equipment;
     25 }
     26 
     27 table Weapon {
     28   name:string;
     29   damage:short;
     30 }
     31 
     32 root_type Monster;
     33