28 lines
397 B
Plaintext
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
|