| 1 |
<!DOCTYPE html> |
| 2 |
<html><head> |
| 3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| 4 |
<title>test.fbs</title> |
| 5 |
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (FlatBuffers) - Theme (Breeze Light)"/> |
| 6 |
</head><body style="background-color:#ffffff;color:#1f1c1b"><pre> |
| 7 |
<span style="color:#898887;">// Example IDL file for our monster's schema.</span> |
| 8 |
|
| 9 |
<span style="font-weight:bold;">namespace</span> MyGame.Sample; |
| 10 |
|
| 11 |
<span style="font-weight:bold;">enum</span> Color:<span style="color:#0057ae;">byte</span> { Red = <span style="color:#b08000;">0</span>, Green, Blue = <span style="color:#b08000;">2</span> } |
| 12 |
|
| 13 |
<span style="font-weight:bold;">union</span> Equipment { Weapon } <span style="color:#898887;">// Optionally add more tables.</span> |
| 14 |
|
| 15 |
<span style="font-weight:bold;">struct</span> Vec3 { |
| 16 |
x:<span style="color:#0057ae;">float</span>; |
| 17 |
y:<span style="color:#0057ae;">float</span>; |
| 18 |
z:<span style="color:#0057ae;">float</span>; |
| 19 |
} |
| 20 |
|
| 21 |
<span style="font-weight:bold;">table</span> Monster { |
| 22 |
pos:Vec3; <span style="color:#898887;">// Struct.</span> |
| 23 |
mana:<span style="color:#0057ae;">short</span> = <span style="color:#b08000;">150</span>; |
| 24 |
hp:<span style="color:#0057ae;">short</span> = <span style="color:#b08000;">100</span>; |
| 25 |
name:<span style="color:#0057ae;">string</span>; |
| 26 |
friendly:<span style="color:#0057ae;">bool</span> = <span style="color:#b08000;">false</span> (<span style="font-weight:bold;">deprecated</span>); |
| 27 |
inventory:[<span style="color:#0057ae;">ubyte</span>]; <span style="color:#898887;">// Vector of scalars.</span> |
| 28 |
color:Color = Blue; <span style="color:#898887;">// Enum.</span> |
| 29 |
weapons:[Weapon]; <span style="color:#898887;">// Vector of tables.</span> |
| 30 |
equipped:Equipment; <span style="color:#898887;">// Union.</span> |
| 31 |
path:[Vec3]; <span style="color:#898887;">// Vector of structs.</span> |
| 32 |
} |
| 33 |
|
| 34 |
<span style="font-weight:bold;">table</span> Weapon { |
| 35 |
name:<span style="color:#0057ae;">string</span>; |
| 36 |
damage:<span style="color:#0057ae;">short</span>; |
| 37 |
} |
| 38 |
|
| 39 |
<span style="font-weight:bold;">root_type</span> Monster; |
| 40 |
</pre></body></html> |