File indexing completed on 2024-05-19 15:23:16
0001 <!DOCTYPE html> 0002 <html><head> 0003 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 0004 <title>test.fbs</title> 0005 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (FlatBuffers) - Theme (Breeze Dark)"/> 0006 </head><body style="background-color:#232629;color:#cfcfc2"><pre> 0007 <span style="color:#7a7c7d;">// Example IDL file for our monster's schema.</span> 0008 0009 <span style="font-weight:bold;">namespace</span> MyGame.Sample; 0010 0011 <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> } 0012 0013 <span style="font-weight:bold;">union</span> Equipment { Weapon } <span style="color:#7a7c7d;">// Optionally add more tables.</span> 0014 0015 <span style="font-weight:bold;">struct</span> Vec3 { 0016 x:<span style="color:#2980b9;">float</span>; 0017 y:<span style="color:#2980b9;">float</span>; 0018 z:<span style="color:#2980b9;">float</span>; 0019 } 0020 0021 <span style="font-weight:bold;">table</span> Monster { 0022 pos:Vec3; <span style="color:#7a7c7d;">// Struct.</span> 0023 mana:<span style="color:#2980b9;">short</span> = <span style="color:#f67400;">150</span>; 0024 hp:<span style="color:#2980b9;">short</span> = <span style="color:#f67400;">100</span>; 0025 name:<span style="color:#2980b9;">string</span>; 0026 friendly:<span style="color:#2980b9;">bool</span> = <span style="color:#f67400;">false</span> (<span style="font-weight:bold;">deprecated</span>); 0027 inventory:[<span style="color:#2980b9;">ubyte</span>]; <span style="color:#7a7c7d;">// Vector of scalars.</span> 0028 color:Color = Blue; <span style="color:#7a7c7d;">// Enum.</span> 0029 weapons:[Weapon]; <span style="color:#7a7c7d;">// Vector of tables.</span> 0030 equipped:Equipment; <span style="color:#7a7c7d;">// Union.</span> 0031 path:[Vec3]; <span style="color:#7a7c7d;">// Vector of structs.</span> 0032 } 0033 0034 <span style="font-weight:bold;">table</span> Weapon { 0035 name:<span style="color:#2980b9;">string</span>; 0036 damage:<span style="color:#2980b9;">short</span>; 0037 } 0038 0039 <span style="font-weight:bold;">root_type</span> Monster; 0040 </pre></body></html>