41 lines
2.0 KiB
HTML
41 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<html><head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
<title>test.fbs</title>
|
|
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (FlatBuffers) - Theme (Breeze Dark)"/>
|
|
</head><body style="background-color:#232629;color:#cfcfc2"><pre>
|
|
<span style="color:#7a7c7d">// Example IDL file for our monster's schema.</span>
|
|
|
|
<span style="font-weight:bold">namespace</span> MyGame.Sample;
|
|
|
|
<span style="font-weight:bold">enum</span> Color:<span style="color:#2980b9">byte</span> { Red = <span style="color:#f67400">0</span>, Green, Blue = <span style="color:#f67400">2</span> }
|
|
|
|
<span style="font-weight:bold">union</span> Equipment { Weapon } <span style="color:#7a7c7d">// Optionally add more tables.</span>
|
|
|
|
<span style="font-weight:bold">struct</span> Vec3 {
|
|
x:<span style="color:#2980b9">float</span>;
|
|
y:<span style="color:#2980b9">float</span>;
|
|
z:<span style="color:#2980b9">float</span>;
|
|
}
|
|
|
|
<span style="font-weight:bold">table</span> Monster {
|
|
pos:Vec3; <span style="color:#7a7c7d">// Struct.</span>
|
|
mana:<span style="color:#2980b9">short</span> = <span style="color:#f67400">150</span>;
|
|
hp:<span style="color:#2980b9">short</span> = <span style="color:#f67400">100</span>;
|
|
name:<span style="color:#2980b9">string</span>;
|
|
friendly:<span style="color:#2980b9">bool</span> = <span style="color:#f67400">false</span> (<span style="font-weight:bold">deprecated</span>);
|
|
inventory:[<span style="color:#2980b9">ubyte</span>]; <span style="color:#7a7c7d">// Vector of scalars.</span>
|
|
color:Color = Blue; <span style="color:#7a7c7d">// Enum.</span>
|
|
weapons:[Weapon]; <span style="color:#7a7c7d">// Vector of tables.</span>
|
|
equipped:Equipment; <span style="color:#7a7c7d">// Union.</span>
|
|
path:[Vec3]; <span style="color:#7a7c7d">// Vector of structs.</span>
|
|
}
|
|
|
|
<span style="font-weight:bold">table</span> Weapon {
|
|
name:<span style="color:#2980b9">string</span>;
|
|
damage:<span style="color:#2980b9">short</span>;
|
|
}
|
|
|
|
<span style="font-weight:bold">root_type</span> Monster;
|
|
</pre></body></html>
|