khaotic-engine-Reborn/doxygen_docs/html/identity__component_8h_source.html

190 lines
22 KiB
HTML

<!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.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Khaotic Engine Reborn: enginecustom/src/inc/system/ecs/components/identity_component.h 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>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<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>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</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">Khaotic Engine Reborn
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<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>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></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>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('identity__component_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- 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">identity_component.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#include &quot;../component.h&quot;</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceecs.html">ecs</a> {</div>
<div class="foldopen" id="foldopen00010" data-start="{" data-end="};">
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"><a class="line" href="namespaceecs.html#ab36dd172176a3da5558233694cbad4ae"> 10</a></span> <span class="keyword">enum class</span> <a class="code hl_enumeration" href="namespaceecs.html#ab36dd172176a3da5558233694cbad4ae">ObjectType</a></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> Sphere,</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> Cube,</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> Terrain,</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> Unknown</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> };</div>
</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
<div class="foldopen" id="foldopen00018" data-start="{" data-end="};">
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="classecs_1_1_identity_component.html"> 18</a></span><span class="keyword">class </span><a class="code hl_class" href="classecs_1_1_identity_component.html">IdentityComponent</a> : <span class="keyword">public</span> <a class="code hl_class" href="classecs_1_1_component.html">Component</a> {</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="classecs_1_1_identity_component.html#a253122e10cbe22c42831d250d48a8316"> 23</a></span> <a class="code hl_function" href="classecs_1_1_identity_component.html#a253122e10cbe22c42831d250d48a8316">IdentityComponent</a>() : m_id(0), m_type(<a class="code hl_enumeration" href="namespaceecs.html#ab36dd172176a3da5558233694cbad4ae">ObjectType</a>::Unknown) {}</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keyword">explicit</span> <a class="code hl_function" href="classecs_1_1_identity_component.html#a253122e10cbe22c42831d250d48a8316">IdentityComponent</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>) : m_id(id), m_type(<a class="code hl_enumeration" href="namespaceecs.html#ab36dd172176a3da5558233694cbad4ae">ObjectType</a>::Unknown) {}</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <a class="code hl_function" href="classecs_1_1_identity_component.html#a253122e10cbe22c42831d250d48a8316">IdentityComponent</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> std::string&amp; name) : m_id(id), m_name(name), m_type(ObjectType::Unknown) {}</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> ~IdentityComponent() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="classecs_1_1_identity_component.html#a04b2bb43ccf6c4842704f30463033b3b"> 33</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classecs_1_1_identity_component.html#a04b2bb43ccf6c4842704f30463033b3b">Initialize</a>()<span class="keyword"> override </span>{}</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="comment">//void Update(float deltaTime) override {}</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="classecs_1_1_identity_component.html#af7fcece7aaa148512ba153d1d3a4cc1c"> 40</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="classecs_1_1_identity_component.html#af7fcece7aaa148512ba153d1d3a4cc1c">GetId</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_id; }</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="classecs_1_1_identity_component.html#a69797f6d9f9926293d2e0b4e84e3bbb3"> 45</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classecs_1_1_identity_component.html#a69797f6d9f9926293d2e0b4e84e3bbb3">SetId</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>) { m_id = id; }</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="classecs_1_1_identity_component.html#a6f97e89a74db7fda99f144c66c17935f"> 51</a></span> <span class="keyword">const</span> std::string&amp; <a class="code hl_function" href="classecs_1_1_identity_component.html#a6f97e89a74db7fda99f144c66c17935f">GetName</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_name; }</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="classecs_1_1_identity_component.html#aa04b3e5f2e40271ba50dfd35c3217013"> 56</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classecs_1_1_identity_component.html#aa04b3e5f2e40271ba50dfd35c3217013">SetName</a>(<span class="keyword">const</span> std::string&amp; name) { m_name = name; }</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="classecs_1_1_identity_component.html#abc33d5a325706c7c115b88fd9635a4cd"> 62</a></span> <a class="code hl_enumeration" href="namespaceecs.html#ab36dd172176a3da5558233694cbad4ae">ObjectType</a> <a class="code hl_function" href="classecs_1_1_identity_component.html#abc33d5a325706c7c115b88fd9635a4cd">GetType</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_type; }</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="classecs_1_1_identity_component.html#a7cbca5e7e2c877b45c900df4660c0e35"> 67</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classecs_1_1_identity_component.html#a7cbca5e7e2c877b45c900df4660c0e35">SetType</a>(<a class="code hl_enumeration" href="namespaceecs.html#ab36dd172176a3da5558233694cbad4ae">ObjectType</a> type) { m_type = type; }</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
<div class="foldopen" id="foldopen00074" data-start="{" data-end="}">
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="classecs_1_1_identity_component.html#a46f22b04d81b17bea5807d5b9d32b328"> 74</a></span> <span class="keyword">static</span> std::string <a class="code hl_function" href="classecs_1_1_identity_component.html#a46f22b04d81b17bea5807d5b9d32b328">ObjectTypeToString</a>(<a class="code hl_enumeration" href="namespaceecs.html#ab36dd172176a3da5558233694cbad4ae">ObjectType</a> type) {</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordflow">switch</span> (type) {</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordflow">case</span> ObjectType::Cube: <span class="keywordflow">return</span> <span class="stringliteral">&quot;Cube&quot;</span>;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">case</span> ObjectType::Sphere: <span class="keywordflow">return</span> <span class="stringliteral">&quot;Sphere&quot;</span>;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordflow">case</span> ObjectType::Terrain: <span class="keywordflow">return</span> <span class="stringliteral">&quot;Terrain&quot;</span>;</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">default</span>: <span class="keywordflow">return</span> <span class="stringliteral">&quot;Unknown&quot;</span>;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> }</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> }</div>
</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
<div class="foldopen" id="foldopen00088" data-start="{" data-end="}">
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="classecs_1_1_identity_component.html#a9a92b2a27ec5399096a3ad196d2dec3f"> 88</a></span> <span class="keyword">static</span> <a class="code hl_enumeration" href="namespaceecs.html#ab36dd172176a3da5558233694cbad4ae">ObjectType</a> <a class="code hl_function" href="classecs_1_1_identity_component.html#a9a92b2a27ec5399096a3ad196d2dec3f">StringToObjectType</a>(<span class="keyword">const</span> std::string&amp; str) {</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordflow">if</span> (str == <span class="stringliteral">&quot;Cube&quot;</span>) <span class="keywordflow">return</span> ObjectType::Cube;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">if</span> (str == <span class="stringliteral">&quot;Sphere&quot;</span>) <span class="keywordflow">return</span> ObjectType::Sphere;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">if</span> (str == <span class="stringliteral">&quot;Terrain&quot;</span>) <span class="keywordflow">return</span> ObjectType::Terrain;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordflow">return</span> ObjectType::Unknown;</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> }</div>
</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keywordtype">int</span> m_id; <span class="comment">// ID unique de l&#39;objet</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> std::string m_name; <span class="comment">// Nom de l&#39;objet</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <a class="code hl_enumeration" href="namespaceecs.html#ab36dd172176a3da5558233694cbad4ae">ObjectType</a> m_type; <span class="comment">// Type de l&#39;objet (Cube, Sphere, Terrain, etc.)</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span>};</div>
</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> </div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span>} <span class="comment">// namespace ecs</span></div>
<div class="ttc" id="aclassecs_1_1_component_html"><div class="ttname"><a href="classecs_1_1_component.html">ecs::Component</a></div><div class="ttdef"><b>Definition</b> <a href="component_8h_source.html#l00012">component.h:12</a></div></div>
<div class="ttc" id="aclassecs_1_1_identity_component_html"><div class="ttname"><a href="classecs_1_1_identity_component.html">ecs::IdentityComponent</a></div><div class="ttdef"><b>Definition</b> <a href="#l00018">identity_component.h:18</a></div></div>
<div class="ttc" id="aclassecs_1_1_identity_component_html_a04b2bb43ccf6c4842704f30463033b3b"><div class="ttname"><a href="classecs_1_1_identity_component.html#a04b2bb43ccf6c4842704f30463033b3b">ecs::IdentityComponent::Initialize</a></div><div class="ttdeci">void Initialize() override</div><div class="ttdef"><b>Definition</b> <a href="#l00033">identity_component.h:33</a></div></div>
<div class="ttc" id="aclassecs_1_1_identity_component_html_a253122e10cbe22c42831d250d48a8316"><div class="ttname"><a href="classecs_1_1_identity_component.html#a253122e10cbe22c42831d250d48a8316">ecs::IdentityComponent::IdentityComponent</a></div><div class="ttdeci">IdentityComponent()</div><div class="ttdef"><b>Definition</b> <a href="#l00023">identity_component.h:23</a></div></div>
<div class="ttc" id="aclassecs_1_1_identity_component_html_a46f22b04d81b17bea5807d5b9d32b328"><div class="ttname"><a href="classecs_1_1_identity_component.html#a46f22b04d81b17bea5807d5b9d32b328">ecs::IdentityComponent::ObjectTypeToString</a></div><div class="ttdeci">static std::string ObjectTypeToString(ObjectType type)</div><div class="ttdef"><b>Definition</b> <a href="#l00074">identity_component.h:74</a></div></div>
<div class="ttc" id="aclassecs_1_1_identity_component_html_a69797f6d9f9926293d2e0b4e84e3bbb3"><div class="ttname"><a href="classecs_1_1_identity_component.html#a69797f6d9f9926293d2e0b4e84e3bbb3">ecs::IdentityComponent::SetId</a></div><div class="ttdeci">void SetId(int id)</div><div class="ttdef"><b>Definition</b> <a href="#l00045">identity_component.h:45</a></div></div>
<div class="ttc" id="aclassecs_1_1_identity_component_html_a6f97e89a74db7fda99f144c66c17935f"><div class="ttname"><a href="classecs_1_1_identity_component.html#a6f97e89a74db7fda99f144c66c17935f">ecs::IdentityComponent::GetName</a></div><div class="ttdeci">const std::string &amp; GetName() const</div><div class="ttdef"><b>Definition</b> <a href="#l00051">identity_component.h:51</a></div></div>
<div class="ttc" id="aclassecs_1_1_identity_component_html_a7cbca5e7e2c877b45c900df4660c0e35"><div class="ttname"><a href="classecs_1_1_identity_component.html#a7cbca5e7e2c877b45c900df4660c0e35">ecs::IdentityComponent::SetType</a></div><div class="ttdeci">void SetType(ObjectType type)</div><div class="ttdef"><b>Definition</b> <a href="#l00067">identity_component.h:67</a></div></div>
<div class="ttc" id="aclassecs_1_1_identity_component_html_a9a92b2a27ec5399096a3ad196d2dec3f"><div class="ttname"><a href="classecs_1_1_identity_component.html#a9a92b2a27ec5399096a3ad196d2dec3f">ecs::IdentityComponent::StringToObjectType</a></div><div class="ttdeci">static ObjectType StringToObjectType(const std::string &amp;str)</div><div class="ttdef"><b>Definition</b> <a href="#l00088">identity_component.h:88</a></div></div>
<div class="ttc" id="aclassecs_1_1_identity_component_html_aa04b3e5f2e40271ba50dfd35c3217013"><div class="ttname"><a href="classecs_1_1_identity_component.html#aa04b3e5f2e40271ba50dfd35c3217013">ecs::IdentityComponent::SetName</a></div><div class="ttdeci">void SetName(const std::string &amp;name)</div><div class="ttdef"><b>Definition</b> <a href="#l00056">identity_component.h:56</a></div></div>
<div class="ttc" id="aclassecs_1_1_identity_component_html_abc33d5a325706c7c115b88fd9635a4cd"><div class="ttname"><a href="classecs_1_1_identity_component.html#abc33d5a325706c7c115b88fd9635a4cd">ecs::IdentityComponent::GetType</a></div><div class="ttdeci">ObjectType GetType() const</div><div class="ttdef"><b>Definition</b> <a href="#l00062">identity_component.h:62</a></div></div>
<div class="ttc" id="aclassecs_1_1_identity_component_html_af7fcece7aaa148512ba153d1d3a4cc1c"><div class="ttname"><a href="classecs_1_1_identity_component.html#af7fcece7aaa148512ba153d1d3a4cc1c">ecs::IdentityComponent::GetId</a></div><div class="ttdeci">int GetId() const</div><div class="ttdef"><b>Definition</b> <a href="#l00040">identity_component.h:40</a></div></div>
<div class="ttc" id="anamespaceecs_html"><div class="ttname"><a href="namespaceecs.html">ecs</a></div><div class="ttdef"><b>Definition</b> <a href="component_8h_source.html#l00009">component.h:9</a></div></div>
<div class="ttc" id="anamespaceecs_html_ab36dd172176a3da5558233694cbad4ae"><div class="ttname"><a href="namespaceecs.html#ab36dd172176a3da5558233694cbad4ae">ecs::ObjectType</a></div><div class="ttdeci">ObjectType</div><div class="ttdef"><b>Definition</b> <a href="#l00010">identity_component.h:11</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_f4a881938f04d9c04de7741e8b9c813b.html">enginecustom</a></li><li class="navelem"><a class="el" href="dir_4288ac3ffb2af5f572fd6fdc04a1176b.html">src</a></li><li class="navelem"><a class="el" href="dir_fa382d1760f3c58d964524ef7c4d69c1.html">inc</a></li><li class="navelem"><a class="el" href="dir_31afb4cde3071d47ca274e3f4ae3badb.html">system</a></li><li class="navelem"><a class="el" href="dir_7ee6018c7c0b4a651bf0164a61d07aa3.html">ecs</a></li><li class="navelem"><a class="el" href="dir_3aed71f4d8c8b4314dfb8ee0eb59e8a7.html">components</a></li><li class="navelem"><b>identity_component.h</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.12.0 </li>
</ul>
</div>
</body>
</html>