diff options
Diffstat (limited to 'samples/monster/monster.fbs')
-rw-r--r-- | samples/monster/monster.fbs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/samples/monster/monster.fbs b/samples/monster/monster.fbs new file mode 100644 index 0000000..12859d2 --- /dev/null +++ b/samples/monster/monster.fbs @@ -0,0 +1,32 @@ +// Example IDL file for our monster's schema. + +namespace MyGame.Sample; + +enum Color:byte { Red = 0, Green, Blue = 2 } + +union Equipment { Weapon } // Optionally add more tables. + +struct Vec3 { + x:float; + y:float; + z:float; +} + +table Monster { + pos:Vec3; // Struct. + mana:short = 150; + hp:short = 100; + name:string; + friendly:bool = false (deprecated); + inventory:[ubyte]; // Vector of scalars. + color:Color = Blue; // Enum. + weapons:[Weapon]; // Vector of tables. + equipped:Equipment; // Union. +} + +table Weapon { + name:string; + damage:short; +} + +root_type Monster; |