godot-cpp-utils-docs/html/game__root_8hpp_source.html

254 lines
38 KiB
HTML
Raw Normal View History

2024-05-29 17:40:11 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>godot-cpp-utils: game_root.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
2024-05-29 21:29:38 +00:00
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
2024-05-29 17:40:11 +00:00
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
2024-05-29 21:29:38 +00:00
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
2024-05-29 17:40:11 +00:00
<link href="doxygen.css" rel="stylesheet" type="text/css" />
2024-05-29 21:38:31 +00:00
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
2024-05-29 17:40:11 +00:00
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">godot-cpp-utils
</div>
<div id="projectbrief">A collection of utility classes, functions and macros for use with Godot and GDExtension.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
2024-05-29 21:29:38 +00:00
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
2024-05-29 17:40:11 +00:00
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
2024-05-29 21:29:38 +00:00
$(document).ready(function(){initNavTree('game__root_8hpp_source.html',''); initResizable(); });
2024-05-29 17:40:11 +00:00
/* @license-end */
</script>
2024-05-29 21:29:38 +00:00
<div id="doc-content">
2024-05-29 17:40:11 +00:00
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">game_root.hpp</div></div>
</div><!--header-->
<div class="contents">
2024-05-29 21:07:31 +00:00
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef UTILS_GAME_ROOT_HPP</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define UTILS_GAME_ROOT_HPP</span></div>
2024-05-29 17:40:11 +00:00
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include &quot;game_mode.hpp&quot;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &quot;game_state.hpp&quot;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &quot;level.hpp&quot;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;godot_cpp/classes/node.hpp&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;godot_cpp/classes/packed_scene.hpp&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;godot_cpp/classes/random_number_generator.hpp&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;godot_cpp/templates/hash_map.hpp&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &lt;godot_cpp/templates/hash_set.hpp&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &lt;godot_cpp/templates/pair.hpp&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include &lt;godot_cpp/templates/pair.hpp&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include &lt;godot_cpp/templates/vector.hpp&gt;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="keyword">namespace </span>gd = godot;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">namespace </span>utils {</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="keyword">class </span>PlayerInput;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="keyword">class </span>IPlayer;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">class </span>SpawnPoint3D;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="classutils_1_1GameRoot3D.html"> 28</a></span><span class="keyword">class </span><a class="code hl_class" href="classutils_1_1GameRoot3D.html">GameRoot3D</a> : <span class="keyword">public</span> gd::Node {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> GDCLASS(<a class="code hl_class" href="classutils_1_1GameRoot3D.html">GameRoot3D</a>, gd::Node);</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">static</span> <span class="keywordtype">void</span> _bind_methods();</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">static</span> <a class="code hl_class" href="classutils_1_1GameRoot3D.html">GameRoot3D</a> *<a class="code hl_function" href="classutils_1_1GameRoot3D.html#ad1c9387dee7919a8ab5d60b19cba2140">get_singleton</a>();</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#a13e110d60dffd924248af9c3f6943706">has_singleton</a>();</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> _enter_tree() <span class="keyword">override</span>;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> _ready() <span class="keyword">override</span>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> _exit_tree() <span class="keyword">override</span>;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#a85eee9cb258971abe9fe8577314b2556">player_input_connected</a>();</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#a89953130655a618aefa8f3ea0db63a53">remove_player</a>(uint32_t player_id);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="comment">// calls remove_player for every used player input slot</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordtype">void</span> remove_all_players();</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#a865e6d9fe4f9422c0fb974bd6b1222ce">initialize_player</a>(<a class="code hl_class" href="classutils_1_1IPlayer.html">IPlayer</a> *player, uint32_t <span class="keywordtype">id</span>);</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#add087bf071383383e68e919173670c47">reset_game_mode</a>();</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <a class="code hl_class" href="classutils_1_1Level3D.html">Level3D</a> *<a class="code hl_function" href="classutils_1_1GameRoot3D.html#acbec3f7b39c8c991a725e611dd8b869e">load_level</a>(gd::Ref&lt;gd::PackedScene&gt; level);</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <a class="code hl_class" href="classutils_1_1Level3D.html">Level3D</a> *<a class="code hl_function" href="classutils_1_1GameRoot3D.html#ad53d50b5b35e4c13bf84f2d9c0f45a0b">load_level_at</a>(gd::Ref&lt;gd::PackedScene&gt; level, gd::Transform3D at);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#a4053b12af23cef53eb294729f1cb3aa8">unload_all_levels</a>();</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#a453c8aa3920d7d0adaf2490c63a7d92c">replace_levels</a>(gd::Ref&lt;gd::PackedScene&gt; level);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#a1937044fe05a903610308f8d382de975">register_spawn_point</a>(<a class="code hl_class" href="classutils_1_1SpawnPoint3D.html">SpawnPoint3D</a> *spawn_point);</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="comment">// remove a spawnpoint so it can&#39;t be used to spawn players</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordtype">void</span> unregister_spawn_point(<a class="code hl_class" href="classutils_1_1SpawnPoint3D.html">SpawnPoint3D</a> *spawn_point);</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordtype">void</span> place_player_at_spawnpoint(<a class="code hl_class" href="classutils_1_1IPlayer.html">IPlayer</a> *player);</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordtype">void</span> player_despawned(uint32_t <span class="keywordtype">id</span>);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#a6c2a1aa2c35808a1b003ae79eac348c2">set_game_mode</a>(gd::Ref&lt;GameMode&gt; prototype);</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <a class="code hl_class" href="classutils_1_1GameMode.html">GameMode</a> *<a class="code hl_function" href="classutils_1_1GameRoot3D.html#a896b4e4d3b9465a83a10249dbd559662">get_game_mode</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <a class="code hl_class" href="classutils_1_1GameState.html">GameState</a> *<a class="code hl_function" href="classutils_1_1GameRoot3D.html#a105011a591cf09368958d4be350ed352">get_game_state</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> gd::HashMap&lt;gd::StringName, Level3D *&gt; &amp;<a class="code hl_function" href="classutils_1_1GameRoot3D.html#aa9ed453a0b416641dfa5154a0b69c79e">get_levels</a>();</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_class" href="classutils_1_1IPlayer.html">IPlayer</a> *<a class="code hl_function" href="classutils_1_1GameRoot3D.html#a27492f37140fa8af6c6955f2147f5521">get_player</a>(uint32_t <span class="keywordtype">id</span>);</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> gd::Vector&lt;IPlayer*&gt; <a class="code hl_function" href="classutils_1_1GameRoot3D.html#af176a558f2a3b972c970087c2a1e3d7b">get_players</a>();</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordtype">void</span> set_first_boot_level(gd::Ref&lt;gd::PackedScene&gt; level);</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> gd::Ref&lt;gd::PackedScene&gt; get_first_boot_level() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordtype">void</span> set_game_state_prototype(gd::Ref&lt;GameState&gt; <a class="code hl_variable" href="classutils_1_1GameRoot3D.html#af73d3a598b72fcdc7dce372ea3af6e44">game_state</a>);</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> gd::Ref&lt;GameState&gt; get_game_state_prototype() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="keyword">protected</span>:</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#a0fc164bad77a192ff2209eee18e5104b">grab_singleton</a>();</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#adc4455c11d39f8a267091f29ead441ee">release_singleton</a>();</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> uint32_t <a class="code hl_function" href="classutils_1_1GameRoot3D.html#ab3895b9b48c4646a876e188d226c5723">find_empty_player_slot</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <a class="code hl_class" href="classutils_1_1IPlayer.html">IPlayer</a> *<a class="code hl_function" href="classutils_1_1GameRoot3D.html#a3e74ac9841575d9a915cf7ac6735b42b">spawn_player</a>(uint32_t <span class="keywordtype">id</span>);</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#af34016620adcdc2654358b463769a85f">level_unloaded</a>(gd::StringName scene_path);</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classutils_1_1GameRoot3D.html#a77e4726bb8fec522669cbb2c068e47d9">is_valid_level</a>(gd::Ref&lt;gd::PackedScene&gt; &amp;level);</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="keyword">static</span> <a class="code hl_class" href="classutils_1_1GameRoot3D.html">GameRoot3D</a> *singleton_instance;</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> </div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="classutils_1_1GameRoot3D.html#af508cc9852b123ea37b94651da0f3c19"> 131</a></span> uint32_t <a class="code hl_variable" href="classutils_1_1GameRoot3D.html#af508cc9852b123ea37b94651da0f3c19">next_player_id</a>{1}; </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"><a class="line" href="classutils_1_1GameRoot3D.html#acf48cbe3b2b6dd064cd1665ea8df2b9a"> 132</a></span> gd::HashMap&lt;uint32_t, gd::Pair&lt;PlayerInput*, IPlayer*&gt;&gt; <a class="code hl_variable" href="classutils_1_1GameRoot3D.html#acf48cbe3b2b6dd064cd1665ea8df2b9a">players</a>{}; </div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> </div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"><a class="line" href="classutils_1_1GameRoot3D.html#a623230c72ced578d7be1b9141b54fbd4"> 134</a></span> gd::RandomNumberGenerator <a class="code hl_variable" href="classutils_1_1GameRoot3D.html#a623230c72ced578d7be1b9141b54fbd4">rng</a>{}; </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="classutils_1_1GameRoot3D.html#a800421c3b82947156eebcbf730a680db"> 135</a></span> gd::HashMap&lt;gd::StringName, Level3D*&gt; <a class="code hl_variable" href="classutils_1_1GameRoot3D.html#a800421c3b82947156eebcbf730a680db">levels</a>{}; </div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"><a class="line" href="classutils_1_1GameRoot3D.html#a116245a9c4e7edf53ec03c6fe78c8462"> 136</a></span> gd::Vector&lt;SpawnPoint3D*&gt; <a class="code hl_variable" href="classutils_1_1GameRoot3D.html#a116245a9c4e7edf53ec03c6fe78c8462">spawn_points</a>{}; </div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"><a class="line" href="classutils_1_1GameRoot3D.html#abb25b7613e1c7cd4f056020e6990d8e1"> 137</a></span> gd::Ref&lt;GameMode&gt; <a class="code hl_variable" href="classutils_1_1GameRoot3D.html#abb25b7613e1c7cd4f056020e6990d8e1">game_mode</a>{}; </div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"><a class="line" href="classutils_1_1GameRoot3D.html#af73d3a598b72fcdc7dce372ea3af6e44"> 142</a></span> gd::Ref&lt;GameState&gt; <a class="code hl_variable" href="classutils_1_1GameRoot3D.html#af73d3a598b72fcdc7dce372ea3af6e44">game_state</a>{};</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> </div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"><a class="line" href="classutils_1_1GameRoot3D.html#abf16d0f3b8030b758942397dcff1d46a"> 144</a></span> gd::Ref&lt;gd::PackedScene&gt; <a class="code hl_variable" href="classutils_1_1GameRoot3D.html#abf16d0f3b8030b758942397dcff1d46a">first_boot_level</a>{}; </div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"><a class="line" href="classutils_1_1GameRoot3D.html#ad62b2be46770ba99aa6c2a7800c52aa8"> 145</a></span> gd::Ref&lt;GameState&gt; <a class="code hl_variable" href="classutils_1_1GameRoot3D.html#ad62b2be46770ba99aa6c2a7800c52aa8">game_state_prototype</a>{}; </div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span>};</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span>}</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
2024-05-29 21:07:31 +00:00
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span><span class="preprocessor">#endif </span><span class="comment">// !UTILS_GAME_ROOT_HPP</span></div>
2024-05-29 17:40:11 +00:00
<div class="ttc" id="aclassutils_1_1GameMode_html"><div class="ttname"><a href="classutils_1_1GameMode.html">utils::GameMode</a></div><div class="ttdoc">Stores session-relevant data.</div><div class="ttdef"><b>Definition</b> game_mode.hpp:15</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html"><div class="ttname"><a href="classutils_1_1GameRoot3D.html">utils::GameRoot3D</a></div><div class="ttdoc">The root of a game.</div><div class="ttdef"><b>Definition</b> game_root.hpp:28</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a0fc164bad77a192ff2209eee18e5104b"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a0fc164bad77a192ff2209eee18e5104b">utils::GameRoot3D::grab_singleton</a></div><div class="ttdeci">void grab_singleton()</div><div class="ttdoc">Attempt to make 'this' the current singleton instance.</div><div class="ttdef"><b>Definition</b> game_root.cpp:249</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a105011a591cf09368958d4be350ed352"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a105011a591cf09368958d4be350ed352">utils::GameRoot3D::get_game_state</a></div><div class="ttdeci">GameState * get_game_state() const</div><div class="ttdoc">Get the current active game state.</div><div class="ttdef"><b>Definition</b> game_root.cpp:203</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a116245a9c4e7edf53ec03c6fe78c8462"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a116245a9c4e7edf53ec03c6fe78c8462">utils::GameRoot3D::spawn_points</a></div><div class="ttdeci">gd::Vector&lt; SpawnPoint3D * &gt; spawn_points</div><div class="ttdoc">all currently available spawn points.</div><div class="ttdef"><b>Definition</b> game_root.hpp:136</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a13e110d60dffd924248af9c3f6943706"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a13e110d60dffd924248af9c3f6943706">utils::GameRoot3D::has_singleton</a></div><div class="ttdeci">static bool has_singleton()</div><div class="ttdoc">returns true if there is currently a singleton active for GameRoot</div><div class="ttdef"><b>Definition</b> game_root.cpp:35</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a1937044fe05a903610308f8d382de975"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a1937044fe05a903610308f8d382de975">utils::GameRoot3D::register_spawn_point</a></div><div class="ttdeci">void register_spawn_point(SpawnPoint3D *spawn_point)</div><div class="ttdoc">Register a spawnpoint for use when spawning players.</div><div class="ttdef"><b>Definition</b> game_root.cpp:146</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a27492f37140fa8af6c6955f2147f5521"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a27492f37140fa8af6c6955f2147f5521">utils::GameRoot3D::get_player</a></div><div class="ttdeci">IPlayer * get_player(uint32_t id)</div><div class="ttdoc">Get the player instance associated with id.</div><div class="ttdef"><b>Definition</b> game_root.cpp:211</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a3e74ac9841575d9a915cf7ac6735b42b"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a3e74ac9841575d9a915cf7ac6735b42b">utils::GameRoot3D::spawn_player</a></div><div class="ttdeci">IPlayer * spawn_player(uint32_t id)</div><div class="ttdoc">Spawn a player to be associated with id.</div><div class="ttdef"><b>Definition</b> game_root.cpp:275</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a4053b12af23cef53eb294729f1cb3aa8"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a4053b12af23cef53eb294729f1cb3aa8">utils::GameRoot3D::unload_all_levels</a></div><div class="ttdeci">void unload_all_levels()</div><div class="ttdoc">Unload all currently loaded levels.</div><div class="ttdef"><b>Definition</b> game_root.cpp:133</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a453c8aa3920d7d0adaf2490c63a7d92c"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a453c8aa3920d7d0adaf2490c63a7d92c">utils::GameRoot3D::replace_levels</a></div><div class="ttdeci">void replace_levels(gd::Ref&lt; gd::PackedScene &gt; level)</div><div class="ttdoc">Replace all currently loaded levels with a new level.</div><div class="ttdef"><b>Definition</b> game_root.cpp:141</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a623230c72ced578d7be1b9141b54fbd4"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a623230c72ced578d7be1b9141b54fbd4">utils::GameRoot3D::rng</a></div><div class="ttdeci">gd::RandomNumberGenerator rng</div><div class="ttdoc">Global random number generator.</div><div class="ttdef"><b>Definition</b> game_root.hpp:134</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a6c2a1aa2c35808a1b003ae79eac348c2"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a6c2a1aa2c35808a1b003ae79eac348c2">utils::GameRoot3D::set_game_mode</a></div><div class="ttdeci">void set_game_mode(gd::Ref&lt; GameMode &gt; prototype)</div><div class="ttdoc">Override the current gamemode.</div><div class="ttdef"><b>Definition</b> game_root.cpp:175</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a77e4726bb8fec522669cbb2c068e47d9"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a77e4726bb8fec522669cbb2c068e47d9">utils::GameRoot3D::is_valid_level</a></div><div class="ttdeci">static bool is_valid_level(gd::Ref&lt; gd::PackedScene &gt; &amp;level)</div><div class="ttdoc">Check if a scene is a valid level.</div><div class="ttdef"><b>Definition</b> game_root.cpp:299</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a800421c3b82947156eebcbf730a680db"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a800421c3b82947156eebcbf730a680db">utils::GameRoot3D::levels</a></div><div class="ttdeci">gd::HashMap&lt; gd::StringName, Level3D * &gt; levels</div><div class="ttdoc">all currently active levels identified by their resource paths.</div><div class="ttdef"><b>Definition</b> game_root.hpp:135</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a85eee9cb258971abe9fe8577314b2556"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a85eee9cb258971abe9fe8577314b2556">utils::GameRoot3D::player_input_connected</a></div><div class="ttdeci">void player_input_connected()</div><div class="ttdoc">Instantiate a new PlayerInput.</div><div class="ttdef"><b>Definition</b> game_root.cpp:53</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a865e6d9fe4f9422c0fb974bd6b1222ce"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a865e6d9fe4f9422c0fb974bd6b1222ce">utils::GameRoot3D::initialize_player</a></div><div class="ttdeci">bool initialize_player(IPlayer *player, uint32_t id)</div><div class="ttdoc">Initialize and register a player instance.</div><div class="ttdef"><b>Definition</b> game_root.cpp:84</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a896b4e4d3b9465a83a10249dbd559662"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a896b4e4d3b9465a83a10249dbd559662">utils::GameRoot3D::get_game_mode</a></div><div class="ttdeci">GameMode * get_game_mode() const</div><div class="ttdoc">get the current active game mode.</div><div class="ttdef"><b>Definition</b> game_root.cpp:199</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_a89953130655a618aefa8f3ea0db63a53"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#a89953130655a618aefa8f3ea0db63a53">utils::GameRoot3D::remove_player</a></div><div class="ttdeci">void remove_player(uint32_t player_id)</div><div class="ttdoc">Force-disconnect a player.</div><div class="ttdef"><b>Definition</b> game_root.cpp:60</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_aa9ed453a0b416641dfa5154a0b69c79e"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#aa9ed453a0b416641dfa5154a0b69c79e">utils::GameRoot3D::get_levels</a></div><div class="ttdeci">gd::HashMap&lt; gd::StringName, Level3D * &gt; &amp; get_levels()</div><div class="ttdoc">Returns all currently active levels.</div><div class="ttdef"><b>Definition</b> game_root.cpp:207</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_ab3895b9b48c4646a876e188d226c5723"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#ab3895b9b48c4646a876e188d226c5723">utils::GameRoot3D::find_empty_player_slot</a></div><div class="ttdeci">uint32_t find_empty_player_slot() const</div><div class="ttdoc">Find a Player Input device not yet associated with a player.</div><div class="ttdef"><b>Definition</b> game_root.cpp:266</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_abb25b7613e1c7cd4f056020e6990d8e1"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#abb25b7613e1c7cd4f056020e6990d8e1">utils::GameRoot3D::game_mode</a></div><div class="ttdeci">gd::Ref&lt; GameMode &gt; game_mode</div><div class="ttdoc">current active gamemode.</div><div class="ttdef"><b>Definition</b> game_root.hpp:137</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_abf16d0f3b8030b758942397dcff1d46a"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#abf16d0f3b8030b758942397dcff1d46a">utils::GameRoot3D::first_boot_level</a></div><div class="ttdeci">gd::Ref&lt; gd::PackedScene &gt; first_boot_level</div><div class="ttdoc">The level to boot into on startup.</div><div class="ttdef"><b>Definition</b> game_root.hpp:144</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_acbec3f7b39c8c991a725e611dd8b869e"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#acbec3f7b39c8c991a725e611dd8b869e">utils::GameRoot3D::load_level</a></div><div class="ttdeci">Level3D * load_level(gd::Ref&lt; gd::PackedScene &gt; level)</div><div class="ttdoc">shorthand for load_level(level, Transform3D())</div><div class="ttdef"><b>Definition</b> game_root.cpp:102</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_acf48cbe3b2b6dd064cd1665ea8df2b9a"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#acf48cbe3b2b6dd064cd1665ea8df2b9a">utils::GameRoot3D::players</a></div><div class="ttdeci">gd::HashMap&lt; uint32_t, gd::Pair&lt; PlayerInput *, IPlayer * &gt; &gt; players</div><div class="ttdoc">all players by id by input device.</div><div class="ttdef"><b>Definition</b> game_root.hpp:132</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_ad1c9387dee7919a8ab5d60b19cba2140"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#ad1c9387dee7919a8ab5d60b19cba2140">utils::GameRoot3D::get_singleton</a></div><div class="ttdeci">static GameRoot3D * get_singleton()</div><div class="ttdoc">get the current active singleton instance of GameRoot</div><div class="ttdef"><b>Definition</b> game_root.cpp:31</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_ad53d50b5b35e4c13bf84f2d9c0f45a0b"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#ad53d50b5b35e4c13bf84f2d9c0f45a0b">utils::GameRoot3D::load_level_at</a></div><div class="ttdeci">Level3D * load_level_at(gd::Ref&lt; gd::PackedScene &gt; level, gd::Transform3D at)</div><div class="ttdoc">Load a level, only works if 'level' is a valid scene where the root Node can cast to 'Level3D'.</div><div class="ttdef"><b>Definition</b> game_root.cpp:106</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_ad62b2be46770ba99aa6c2a7800c52aa8"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#ad62b2be46770ba99aa6c2a7800c52aa8">utils::GameRoot3D::game_state_prototype</a></div><div class="ttdeci">gd::Ref&lt; GameState &gt; game_state_prototype</div><div class="ttdoc">The default game state data used for game_state if no save data is available.</div><div class="ttdef"><b>Definition</b> game_root.hpp:145</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_adc4455c11d39f8a267091f29ead441ee"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#adc4455c11d39f8a267091f29ead441ee">utils::GameRoot3D::release_singleton</a></div><div class="ttdeci">void release_singleton()</div><div class="ttdoc">Attempt to stop being the active singleton instance.</div><div class="ttdef"><b>Definition</b> game_root.cpp:258</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_add087bf071383383e68e919173670c47"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#add087bf071383383e68e919173670c47">utils::GameRoot3D::reset_game_mode</a></div><div class="ttdeci">void reset_game_mode()</div><div class="ttdoc">Un-set game mode.</div><div class="ttdef"><b>Definition</b> game_root.cpp:98</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_af176a558f2a3b972c970087c2a1e3d7b"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#af176a558f2a3b972c970087c2a1e3d7b">utils::GameRoot3D::get_players</a></div><div class="ttdeci">gd::Vector&lt; IPlayer * &gt; get_players()</div><div class="ttdoc">Get all players in a list.</div><div class="ttdef"><b>Definition</b> game_root.cpp:215</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_af34016620adcdc2654358b463769a85f"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#af34016620adcdc2654358b463769a85f">utils::GameRoot3D::level_unloaded</a></div><div class="ttdeci">void level_unloaded(gd::StringName scene_path)</div><div class="ttdoc">Callback for a level exiting the tree.</div><div class="ttdef"><b>Definition</b> game_root.cpp:295</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_af508cc9852b123ea37b94651da0f3c19"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#af508cc9852b123ea37b94651da0f3c19">utils::GameRoot3D::next_player_id</a></div><div class="ttdeci">uint32_t next_player_id</div><div class="ttdoc">Next available player ID.</div><div class="ttdef"><b>Definition</b> game_root.hpp:131</div></div>
<div class="ttc" id="aclassutils_1_1GameRoot3D_html_af73d3a598b72fcdc7dce372ea3af6e44"><div class="ttname"><a href="classutils_1_1GameRoot3D.html#af73d3a598b72fcdc7dce372ea3af6e44">utils::GameRoot3D::game_state</a></div><div class="ttdeci">gd::Ref&lt; GameState &gt; game_state</div><div class="ttdoc">Active game state.</div><div class="ttdef"><b>Definition</b> game_root.hpp:142</div></div>
<div class="ttc" id="aclassutils_1_1GameState_html"><div class="ttname"><a href="classutils_1_1GameState.html">utils::GameState</a></div><div class="ttdoc">Parent class for saved game state.</div><div class="ttdef"><b>Definition</b> game_state.hpp:11</div></div>
<div class="ttc" id="aclassutils_1_1IPlayer_html"><div class="ttname"><a href="classutils_1_1IPlayer.html">utils::IPlayer</a></div><div class="ttdoc">Interface required for player nodes.</div><div class="ttdef"><b>Definition</b> player.hpp:19</div></div>
<div class="ttc" id="aclassutils_1_1Level3D_html"><div class="ttname"><a href="classutils_1_1Level3D.html">utils::Level3D</a></div><div class="ttdoc">3D level root to be used with GameRoot3D.</div><div class="ttdef"><b>Definition</b> level.hpp:14</div></div>
<div class="ttc" id="aclassutils_1_1SpawnPoint3D_html"><div class="ttname"><a href="classutils_1_1SpawnPoint3D.html">utils::SpawnPoint3D</a></div><div class="ttdoc">A location in the game world that the player can spawn at.</div><div class="ttdef"><b>Definition</b> spawn_point.hpp:13</div></div>
</div><!-- fragment --></div><!-- contents -->
2024-05-29 21:29:38 +00:00
</div><!-- doc-content -->
2024-05-29 17:40:11 +00:00
<!-- start footer part -->
2024-05-29 21:29:38 +00:00
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><b>game_root.hpp</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7 </li>
</ul>
</div>
2024-05-29 17:40:11 +00:00
</body>
</html>