flatbuffers/tests/union_vector/union_vector.fbs

32 lines
570 B
Plaintext
Raw Normal View History

// Demonstrates the ability to have vectors of unions, and also to
// store structs and strings in unions.
table Attacker {
2017-01-24 19:52:36 +00:00
sword_attack_damage: int;
}
struct Rapunzel {
2017-01-24 19:52:36 +00:00
hair_length: int;
}
struct BookReader {
2017-01-24 19:52:36 +00:00
books_read: int;
}
union Character {
MuLan: Attacker, // Can have name be different from type.
Rapunzel, // Or just both the same, as before.
Belle: BookReader,
BookFan: BookReader,
Other: string,
Unused: string
2017-01-24 19:52:36 +00:00
}
table Movie {
main_character: Character;
2017-01-24 19:52:36 +00:00
characters: [Character];
}
root_type Movie;
file_identifier "MOVI";