aboutsummaryrefslogtreecommitdiff
path: root/samples/monster/monster.fbs
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-07-16 02:03:33 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-07-16 02:03:33 +0200
commit5a40295c4cf0af5ea8da9ced04a4ce7d3621a080 (patch)
treecb21506e7b04d10b45d6066a0ee1655563d5d52b /samples/monster/monster.fbs
Squashed 'flatcc/' content from commit 473da2a
git-subtree-dir: flatcc git-subtree-split: 473da2afa5ca435363f8c5e6569167aee6bc31c5
Diffstat (limited to 'samples/monster/monster.fbs')
-rw-r--r--samples/monster/monster.fbs32
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;