Files
flatbuffers/tests/monster_test.fbs
Wouter van Oortmerssen 127d35085a Added a bit_flags attribute to enum declarations that 1<<N every value.
Change-Id: Ib9ec0cb3ddec60b1ca124eaf815fb1ae0cc53e1c
Tested: on Windows and Linux
Bug: 16186562
2014-07-21 16:40:39 -07:00

39 lines
872 B
Plaintext
Executable File

// example IDL file
namespace MyGame.Example;
enum Color:byte (bit_flags) { Red = 0, Green, Blue = 3 }
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;
test2:byte;
test3:Test;
}
table Monster {
pos:Vec3 (id: 0);
hp:short = 100 (id: 2);
mana:short = 150 (id: 1);
name:string (id: 3);
color:Color = Blue (id: 6);
inventory:[ubyte] (id: 5);
friendly:bool = false (deprecated, priority: 1, id: 4);
/// an example documentation comment: this will end up in the generated code
/// multiline too
testarrayoftables:[Monster] (id: 11);
testarrayofstring:[string] (id: 10);
enemy:Monster (id:12);
test:Any (id: 8);
test4:[Test] (id: 9);
testnestedflatbuffer:[ubyte] (id:13, nested_flatbuffer: "Monster");
}
root_type Monster;