Files
damus/flatbuffers/Documentation.docc/Resources/code/fbs/monster_step_7.fbs
2023-08-26 20:46:42 -07:00

28 lines
397 B
Plaintext

enum Color:byte { red, green, blue }
union Equipment { Weapon } // Optionally add more tables.
struct Vec3 {
x:float;
y:float;
}
table Monster {
pos:Vec3;
color:Color = Blue;
mana:short = 150;
hp:short = 100;
name:string;
equipped:Equipment;
weapons:[Weapon];
path:[Vec3];
}
table Weapon {
name:string;
damage:short;
}
root_type Monster; // flatc --swift monster.fbs