Files
Bomberman/MenuControllableSystem_8hpp_source.html
2021-06-26 11:31:13 +00:00

138 lines
17 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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bomberman: sources/System/MenuControllable/MenuControllableSystem.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>
<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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bomberman
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- 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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_08d237fc27d4ecd563f71c5d52f2fecc.html">sources</a></li><li class="navelem"><a class="el" href="dir_dbff9d19e82c23288cf26fa638b485e8.html">System</a></li><li class="navelem"><a class="el" href="dir_448203cd6cf96619aeebdd82741a2c6b.html">MenuControllable</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">MenuControllableSystem.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="MenuControllableSystem_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">// Created by Louis Auzuret on 06/03/21</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160; </div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="ControllableComponent_8hpp.html">Component/Controllable/ControllableComponent.hpp</a>&quot;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sources_2Models_2Vector2_8hpp.html">Models/Vector2.hpp</a>&quot;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="System_8hpp.html">System/System.hpp</a>&quot;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="PositionComponent_8hpp.html">Component/Position/PositionComponent.hpp</a>&quot;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Drawable2DComponent_8hpp.html">Component/Renderer/Drawable2DComponent.hpp</a>&quot;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="ButtonComponent_8hpp.html">Component/Button/ButtonComponent.hpp</a>&quot;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceBBM.html">BBM</a></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;{</div>
<div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="classBBM_1_1MenuControllableSystem.html"> 17</a></span>&#160; <span class="keyword">class </span><a class="code" href="classBBM_1_1MenuControllableSystem.html">MenuControllableSystem</a> : <span class="keyword">public</span> <a class="code" href="classWAL_1_1System.html">WAL::System</a>&lt;&gt;</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160; {</div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="classBBM_1_1MenuControllableSystem.html#aeaf5cbd40df2a402c84f14f102e623be"> 21</a></span>&#160; <a class="code" href="classBBM_1_1Vector2.html">Vector2f</a> <a class="code" href="classBBM_1_1MenuControllableSystem.html#aeaf5cbd40df2a402c84f14f102e623be">_oldMousePosition</a>;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classBBM_1_1MenuControllableSystem.html#a40c1df2dc0823fc7f49dd20fcfd4a111">_updateCurrentButton</a>(<span class="keywordtype">bool</span> selected, <a class="code" href="classBBM_1_1Vector2.html">Vector2f</a> move);</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classBBM_1_1MenuControllableSystem.html#a5a718d3725e8caa67c8fbbeed6760d33">_mouseOnButton</a>(<span class="keyword">const</span> <a class="code" href="classBBM_1_1Vector2.html">Vector2f</a> &amp;mousePos, <a class="code" href="classWAL_1_1ViewEntity.html">WAL::ViewEntity&lt;OnClickComponent, OnHoverComponent, OnIdleComponent, PositionComponent, Drawable2DComponent&gt;</a> &amp;entity) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="classBBM_1_1MenuControllableSystem.html#ac93a764310d69ba8f0166e1816f2d672"> 31</a></span>&#160; <a class="code" href="classWAL_1_1Entity.html">WAL::Entity</a> *<a class="code" href="classBBM_1_1MenuControllableSystem.html#ac93a764310d69ba8f0166e1816f2d672">currentButton</a>;</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="classBBM_1_1MenuControllableSystem.html#afe735a5964a2f3d1d3f51212cb707471"> 34</a></span>&#160; std::chrono::time_point&lt;std::chrono::steady_clock&gt; <a class="code" href="classBBM_1_1MenuControllableSystem.html#afe735a5964a2f3d1d3f51212cb707471">now</a>;</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classBBM_1_1MenuControllableSystem.html#a94b1476bb3f130ed5054f81740d5984d">onSelfUpdate</a>(std::chrono::nanoseconds dtime) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keyword">explicit</span> <a class="code" href="classBBM_1_1MenuControllableSystem.html#a2aa3b5c0edc465b809adb32a3fd612e4">MenuControllableSystem</a>(<a class="code" href="classWAL_1_1Wal.html">WAL::Wal</a> &amp;wal);</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <a class="code" href="classBBM_1_1MenuControllableSystem.html#a2aa3b5c0edc465b809adb32a3fd612e4">MenuControllableSystem</a>(<span class="keyword">const</span> <a class="code" href="classBBM_1_1MenuControllableSystem.html">MenuControllableSystem</a> &amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <a class="code" href="classBBM_1_1MenuControllableSystem.html#afd690ff8362c249fbd3b5dcef0d03451">~MenuControllableSystem</a>() <span class="keyword">override</span> = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <a class="code" href="classBBM_1_1MenuControllableSystem.html">MenuControllableSystem</a> &amp;<a class="code" href="classBBM_1_1MenuControllableSystem.html#acfee46821b2925839f7d8fcb2d92c990">operator=</a>(<span class="keyword">const</span> <a class="code" href="classBBM_1_1MenuControllableSystem.html">MenuControllableSystem</a> &amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; };</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclassBBM_1_1Vector2_html"><div class="ttname"><a href="classBBM_1_1Vector2.html">BBM::Vector2&lt; float &gt;</a></div></div>
<div class="ttc" id="aclassBBM_1_1MenuControllableSystem_html_afd690ff8362c249fbd3b5dcef0d03451"><div class="ttname"><a href="classBBM_1_1MenuControllableSystem.html#afd690ff8362c249fbd3b5dcef0d03451">BBM::MenuControllableSystem::~MenuControllableSystem</a></div><div class="ttdeci">~MenuControllableSystem() override=default</div><div class="ttdoc">A default destructor.</div></div>
<div class="ttc" id="aclassWAL_1_1ViewEntity_html"><div class="ttname"><a href="classWAL_1_1ViewEntity.html">WAL::ViewEntity</a></div><div class="ttdef"><b>Definition:</b> View.hpp:19</div></div>
<div class="ttc" id="aSystem_8hpp_html"><div class="ttname"><a href="System_8hpp.html">System.hpp</a></div></div>
<div class="ttc" id="aclassBBM_1_1MenuControllableSystem_html"><div class="ttname"><a href="classBBM_1_1MenuControllableSystem.html">BBM::MenuControllableSystem</a></div><div class="ttdoc">A system to handle Controllable entities in a menu.</div><div class="ttdef"><b>Definition:</b> MenuControllableSystem.hpp:17</div></div>
<div class="ttc" id="aclassBBM_1_1MenuControllableSystem_html_afe735a5964a2f3d1d3f51212cb707471"><div class="ttname"><a href="classBBM_1_1MenuControllableSystem.html#afe735a5964a2f3d1d3f51212cb707471">BBM::MenuControllableSystem::now</a></div><div class="ttdeci">std::chrono::time_point&lt; std::chrono::steady_clock &gt; now</div><div class="ttdoc">time (in millisecond) since last check</div><div class="ttdef"><b>Definition:</b> MenuControllableSystem.hpp:34</div></div>
<div class="ttc" id="asources_2Models_2Vector2_8hpp_html"><div class="ttname"><a href="sources_2Models_2Vector2_8hpp.html">Vector2.hpp</a></div></div>
<div class="ttc" id="aclassBBM_1_1MenuControllableSystem_html_aeaf5cbd40df2a402c84f14f102e623be"><div class="ttname"><a href="classBBM_1_1MenuControllableSystem.html#aeaf5cbd40df2a402c84f14f102e623be">BBM::MenuControllableSystem::_oldMousePosition</a></div><div class="ttdeci">Vector2f _oldMousePosition</div><div class="ttdoc">position of the mouse at the precedent scene (to know which controller event to watch)</div><div class="ttdef"><b>Definition:</b> MenuControllableSystem.hpp:21</div></div>
<div class="ttc" id="anamespaceBBM_html"><div class="ttname"><a href="namespaceBBM.html">BBM</a></div><div class="ttdef"><b>Definition:</b> AnimationsComponent.cpp:9</div></div>
<div class="ttc" id="aPositionComponent_8hpp_html"><div class="ttname"><a href="PositionComponent_8hpp.html">PositionComponent.hpp</a></div></div>
<div class="ttc" id="aclassWAL_1_1Wal_html"><div class="ttname"><a href="classWAL_1_1Wal.html">WAL::Wal</a></div><div class="ttdoc">The main WAL class, it is used to setup and run the ECS.</div><div class="ttdef"><b>Definition:</b> Wal.hpp:27</div></div>
<div class="ttc" id="aclassWAL_1_1Entity_html"><div class="ttname"><a href="classWAL_1_1Entity.html">WAL::Entity</a></div><div class="ttdoc">An entity of the WAL's ECS.</div><div class="ttdef"><b>Definition:</b> Entity.hpp:20</div></div>
<div class="ttc" id="aclassBBM_1_1MenuControllableSystem_html_a40c1df2dc0823fc7f49dd20fcfd4a111"><div class="ttname"><a href="classBBM_1_1MenuControllableSystem.html#a40c1df2dc0823fc7f49dd20fcfd4a111">BBM::MenuControllableSystem::_updateCurrentButton</a></div><div class="ttdeci">void _updateCurrentButton(bool selected, Vector2f move)</div><div class="ttdoc">update current button reference</div><div class="ttdef"><b>Definition:</b> MenuControllableSystem.cpp:26</div></div>
<div class="ttc" id="aclassBBM_1_1MenuControllableSystem_html_a94b1476bb3f130ed5054f81740d5984d"><div class="ttname"><a href="classBBM_1_1MenuControllableSystem.html#a94b1476bb3f130ed5054f81740d5984d">BBM::MenuControllableSystem::onSelfUpdate</a></div><div class="ttdeci">void onSelfUpdate(std::chrono::nanoseconds dtime) override</div><div class="ttdoc">A method called after all entities that this system manage has been updated.</div><div class="ttdef"><b>Definition:</b> MenuControllableSystem.cpp:76</div></div>
<div class="ttc" id="aControllableComponent_8hpp_html"><div class="ttname"><a href="ControllableComponent_8hpp.html">ControllableComponent.hpp</a></div></div>
<div class="ttc" id="aclassBBM_1_1MenuControllableSystem_html_a2aa3b5c0edc465b809adb32a3fd612e4"><div class="ttname"><a href="classBBM_1_1MenuControllableSystem.html#a2aa3b5c0edc465b809adb32a3fd612e4">BBM::MenuControllableSystem::MenuControllableSystem</a></div><div class="ttdeci">MenuControllableSystem(WAL::Wal &amp;wal)</div><div class="ttdoc">A default constructor.</div><div class="ttdef"><b>Definition:</b> MenuControllableSystem.cpp:19</div></div>
<div class="ttc" id="aclassWAL_1_1System_html"><div class="ttname"><a href="classWAL_1_1System.html">WAL::System</a></div><div class="ttdoc">A base system of WAL.</div><div class="ttdef"><b>Definition:</b> System.hpp:22</div></div>
<div class="ttc" id="aDrawable2DComponent_8hpp_html"><div class="ttname"><a href="Drawable2DComponent_8hpp.html">Drawable2DComponent.hpp</a></div></div>
<div class="ttc" id="aButtonComponent_8hpp_html"><div class="ttname"><a href="ButtonComponent_8hpp.html">ButtonComponent.hpp</a></div></div>
<div class="ttc" id="aclassBBM_1_1MenuControllableSystem_html_ac93a764310d69ba8f0166e1816f2d672"><div class="ttname"><a href="classBBM_1_1MenuControllableSystem.html#ac93a764310d69ba8f0166e1816f2d672">BBM::MenuControllableSystem::currentButton</a></div><div class="ttdeci">WAL::Entity * currentButton</div><div class="ttdoc">index of the current button selected</div><div class="ttdef"><b>Definition:</b> MenuControllableSystem.hpp:31</div></div>
<div class="ttc" id="aclassBBM_1_1MenuControllableSystem_html_acfee46821b2925839f7d8fcb2d92c990"><div class="ttname"><a href="classBBM_1_1MenuControllableSystem.html#acfee46821b2925839f7d8fcb2d92c990">BBM::MenuControllableSystem::operator=</a></div><div class="ttdeci">MenuControllableSystem &amp; operator=(const MenuControllableSystem &amp;)=delete</div><div class="ttdoc">A MenuControllable system is not assignable.</div></div>
<div class="ttc" id="aclassBBM_1_1MenuControllableSystem_html_a5a718d3725e8caa67c8fbbeed6760d33"><div class="ttname"><a href="classBBM_1_1MenuControllableSystem.html#a5a718d3725e8caa67c8fbbeed6760d33">BBM::MenuControllableSystem::_mouseOnButton</a></div><div class="ttdeci">bool _mouseOnButton(const Vector2f &amp;mousePos, WAL::ViewEntity&lt; OnClickComponent, OnHoverComponent, OnIdleComponent, PositionComponent, Drawable2DComponent &gt; &amp;entity) const</div><div class="ttdef"><b>Definition:</b> MenuControllableSystem.cpp:56</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>