2014-09-23 00:17:13 +00:00
|
|
|
// test schema file
|
2014-01-28 00:52:49 +00:00
|
|
|
|
2014-08-19 21:20:05 +00:00
|
|
|
include "include_test1.fbs";
|
|
|
|
|
2014-01-28 00:52:49 +00:00
|
|
|
namespace MyGame.Example;
|
|
|
|
|
2014-11-18 01:27:26 +00:00
|
|
|
attribute "priority";
|
|
|
|
|
2014-08-21 22:17:45 +00:00
|
|
|
enum Color:byte (bit_flags) { Red = 0, Green, Blue = 3, }
|
2014-01-28 00:52:49 +00:00
|
|
|
|
|
|
|
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;
|
2014-09-23 18:55:42 +00:00
|
|
|
test2:Color;
|
2014-01-28 00:52:49 +00:00
|
|
|
test3:Test;
|
|
|
|
}
|
|
|
|
|
2014-09-25 22:53:56 +00:00
|
|
|
table Stat {
|
|
|
|
id:string;
|
|
|
|
val:long;
|
|
|
|
}
|
|
|
|
|
2014-01-28 00:52:49 +00:00
|
|
|
table Monster {
|
2014-07-08 00:34:23 +00:00
|
|
|
pos:Vec3 (id: 0);
|
|
|
|
hp:short = 100 (id: 2);
|
|
|
|
mana:short = 150 (id: 1);
|
2015-01-08 01:51:31 +00:00
|
|
|
name:string (id: 3, required, key);
|
2014-07-08 00:34:23 +00:00
|
|
|
color:Color = Blue (id: 6);
|
|
|
|
inventory:[ubyte] (id: 5);
|
|
|
|
friendly:bool = false (deprecated, priority: 1, id: 4);
|
2014-01-28 00:52:49 +00:00
|
|
|
/// an example documentation comment: this will end up in the generated code
|
|
|
|
/// multiline too
|
2014-07-08 00:34:23 +00:00
|
|
|
testarrayoftables:[Monster] (id: 11);
|
|
|
|
testarrayofstring:[string] (id: 10);
|
2014-07-09 18:44:26 +00:00
|
|
|
enemy:Monster (id:12);
|
2014-07-08 00:34:23 +00:00
|
|
|
test:Any (id: 8);
|
|
|
|
test4:[Test] (id: 9);
|
2014-07-16 00:50:22 +00:00
|
|
|
testnestedflatbuffer:[ubyte] (id:13, nested_flatbuffer: "Monster");
|
2014-09-25 22:53:56 +00:00
|
|
|
testempty:Stat (id:14);
|
2015-01-17 01:48:51 +00:00
|
|
|
testbool:bool (id:15);
|
2015-02-13 23:58:29 +00:00
|
|
|
testhashs32_fnv1:int (id:16, hash:"fnv1_32");
|
|
|
|
testhashu32_fnv1:uint (id:17, hash:"fnv1_32");
|
|
|
|
testhashs64_fnv1:long (id:18, hash:"fnv1_64");
|
|
|
|
testhashu64_fnv1:ulong (id:19, hash:"fnv1_64");
|
|
|
|
testhashs32_fnv1a:int (id:20, hash:"fnv1a_32");
|
|
|
|
testhashu32_fnv1a:uint (id:21, hash:"fnv1a_32");
|
|
|
|
testhashs64_fnv1a:long (id:22, hash:"fnv1a_64");
|
|
|
|
testhashu64_fnv1a:ulong (id:23, hash:"fnv1a_64");
|
2014-01-28 00:52:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
root_type Monster;
|
2014-07-31 22:11:03 +00:00
|
|
|
|
|
|
|
file_identifier "MONS";
|
|
|
|
file_extension "mon";
|