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

140 lines
16 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/Component/Health/HealthComponent.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_1625c0207da71ef5bcc742f7d87fc397.html">Component</a></li><li class="navelem"><a class="el" href="dir_eedd1f11d8d322bfa9082da060c10cd2.html">Health</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">HealthComponent.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="HealthComponent_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 Tom Augier on 2021-05-20.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// Edited by Benjamin Henry on 2021-05-20.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">// Edited by Louis Auzuret on 2021-05-20.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">//</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">#pragma once</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160; </div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="Callback_8hpp.html">Models/Callback.hpp</a>&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Component_8hpp.html">Component/Component.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="Entity_8hpp.html">Entity/Entity.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="Wal_8hpp.html">Wal.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="l00016"></a><span class="lineno"><a class="line" href="classBBM_1_1HealthComponent.html"> 16</a></span>&#160; <span class="keyword">class </span><a class="code" href="classBBM_1_1HealthComponent.html">HealthComponent</a> : <span class="keyword">public</span> <a class="code" href="classWAL_1_1Component.html">WAL::Component</a></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160; {</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_1HealthComponent.html#a0dcb9db6a32f7dc6144a881c846aa3eb"> 21</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classBBM_1_1HealthComponent.html#a0dcb9db6a32f7dc6144a881c846aa3eb">_healthPoint</a>;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="classBBM_1_1HealthComponent.html#ab6e6c483cf90f16a45cfa1dda3ed5e9e"> 25</a></span>&#160; <a class="code" href="classWAL_1_1Callback.html">WAL::Callback&lt;WAL::Entity &amp;, WAL::Wal &amp;&gt;</a> <a class="code" href="classBBM_1_1HealthComponent.html#ab6e6c483cf90f16a45cfa1dda3ed5e9e">onDeath</a>;</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">void</span> <a class="code" href="classBBM_1_1HealthComponent.html#ab8ae4426222d4d531f8d12d29723fbe9">addHealthPoint</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> healthPoint);</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classBBM_1_1HealthComponent.html#ac7c0169337f0a000a7009aeb942a3805">takeDmg</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> damage);</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"> 34</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classBBM_1_1HealthComponent.html#a64d002dfb8b5ad39fb658684c93e576f">getHealthPoint</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <a class="code" href="classWAL_1_1Component.html">WAL::Component</a> *<a class="code" href="classBBM_1_1HealthComponent.html#a7b306deb84464d098401a90d329d0e9b">clone</a>(<a class="code" href="classWAL_1_1Entity.html">WAL::Entity</a> &amp;entity) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <a class="code" href="classBBM_1_1HealthComponent.html#ade53c57050557a4b45503b0f9d83cec9">HealthComponent</a>(<a class="code" href="classWAL_1_1Entity.html">WAL::Entity</a> &amp;entity, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> healthPoint, <span class="keyword">const</span> <a class="code" href="classWAL_1_1Callback.html">WAL::Callback&lt;WAL::Entity &amp;, WAL::Wal &amp;&gt;</a> &amp;onDeathCallback = <a class="code" href="classWAL_1_1Callback.html">WAL::Callback&lt;WAL::Entity &amp;, WAL::Wal &amp;&gt;</a>());</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <a class="code" href="classBBM_1_1HealthComponent.html#ade53c57050557a4b45503b0f9d83cec9">HealthComponent</a>(<span class="keyword">const</span> <a class="code" href="classBBM_1_1HealthComponent.html">HealthComponent</a> &amp;) = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; </div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <a class="code" href="classBBM_1_1HealthComponent.html#a4953b0657d0bca94a1474f83ff57ee1f">~HealthComponent</a>() <span class="keyword">override</span> = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <a class="code" href="classBBM_1_1HealthComponent.html">HealthComponent</a> &amp;<a class="code" href="classBBM_1_1HealthComponent.html#af4cb5fa2938b447afaffe0a09f86e8a7">operator=</a>(<span class="keyword">const</span> <a class="code" href="classBBM_1_1HealthComponent.html">HealthComponent</a> &amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; };</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclassBBM_1_1HealthComponent_html_ac7c0169337f0a000a7009aeb942a3805"><div class="ttname"><a href="classBBM_1_1HealthComponent.html#ac7c0169337f0a000a7009aeb942a3805">BBM::HealthComponent::takeDmg</a></div><div class="ttdeci">void takeDmg(unsigned int damage)</div><div class="ttdoc">reduce health</div><div class="ttdef"><b>Definition:</b> HealthComponent.cpp:29</div></div>
<div class="ttc" id="aclassBBM_1_1HealthComponent_html_a4953b0657d0bca94a1474f83ff57ee1f"><div class="ttname"><a href="classBBM_1_1HealthComponent.html#a4953b0657d0bca94a1474f83ff57ee1f">BBM::HealthComponent::~HealthComponent</a></div><div class="ttdeci">~HealthComponent() override=default</div><div class="ttdoc">default destructor</div></div>
<div class="ttc" id="aCallback_8hpp_html"><div class="ttname"><a href="Callback_8hpp.html">Callback.hpp</a></div></div>
<div class="ttc" id="aclassBBM_1_1HealthComponent_html_ab6e6c483cf90f16a45cfa1dda3ed5e9e"><div class="ttname"><a href="classBBM_1_1HealthComponent.html#ab6e6c483cf90f16a45cfa1dda3ed5e9e">BBM::HealthComponent::onDeath</a></div><div class="ttdeci">WAL::Callback&lt; WAL::Entity &amp;, WAL::Wal &amp; &gt; onDeath</div><div class="ttdoc">The callback invoked on this entity's death.</div><div class="ttdef"><b>Definition:</b> HealthComponent.hpp:25</div></div>
<div class="ttc" id="aclassWAL_1_1Component_html"><div class="ttname"><a href="classWAL_1_1Component.html">WAL::Component</a></div><div class="ttdoc">Represent a single component of WAL.</div><div class="ttdef"><b>Definition:</b> Component.hpp:17</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="aEntity_8hpp_html"><div class="ttname"><a href="Entity_8hpp.html">Entity.hpp</a></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="aComponent_8hpp_html"><div class="ttname"><a href="Component_8hpp.html">Component.hpp</a></div></div>
<div class="ttc" id="aclassBBM_1_1HealthComponent_html_ab8ae4426222d4d531f8d12d29723fbe9"><div class="ttname"><a href="classBBM_1_1HealthComponent.html#ab8ae4426222d4d531f8d12d29723fbe9">BBM::HealthComponent::addHealthPoint</a></div><div class="ttdeci">void addHealthPoint(unsigned int healthPoint)</div><div class="ttdoc">add health to the entity</div><div class="ttdef"><b>Definition:</b> HealthComponent.cpp:24</div></div>
<div class="ttc" id="aclassWAL_1_1Callback_html"><div class="ttname"><a href="classWAL_1_1Callback.html">WAL::Callback&lt; WAL::Entity &amp;, WAL::Wal &amp; &gt;</a></div></div>
<div class="ttc" id="aclassBBM_1_1HealthComponent_html"><div class="ttname"><a href="classBBM_1_1HealthComponent.html">BBM::HealthComponent</a></div><div class="ttdef"><b>Definition:</b> HealthComponent.hpp:16</div></div>
<div class="ttc" id="aclassBBM_1_1HealthComponent_html_a0dcb9db6a32f7dc6144a881c846aa3eb"><div class="ttname"><a href="classBBM_1_1HealthComponent.html#a0dcb9db6a32f7dc6144a881c846aa3eb">BBM::HealthComponent::_healthPoint</a></div><div class="ttdeci">unsigned int _healthPoint</div><div class="ttdoc">life of an entity</div><div class="ttdef"><b>Definition:</b> HealthComponent.hpp:21</div></div>
<div class="ttc" id="aWal_8hpp_html"><div class="ttname"><a href="Wal_8hpp.html">Wal.hpp</a></div></div>
<div class="ttc" id="aclassBBM_1_1HealthComponent_html_a64d002dfb8b5ad39fb658684c93e576f"><div class="ttname"><a href="classBBM_1_1HealthComponent.html#a64d002dfb8b5ad39fb658684c93e576f">BBM::HealthComponent::getHealthPoint</a></div><div class="ttdeci">unsigned int getHealthPoint(void) const</div><div class="ttdoc">return health point of the entity</div><div class="ttdef"><b>Definition:</b> HealthComponent.cpp:37</div></div>
<div class="ttc" id="aclassBBM_1_1HealthComponent_html_af4cb5fa2938b447afaffe0a09f86e8a7"><div class="ttname"><a href="classBBM_1_1HealthComponent.html#af4cb5fa2938b447afaffe0a09f86e8a7">BBM::HealthComponent::operator=</a></div><div class="ttdeci">HealthComponent &amp; operator=(const HealthComponent &amp;)=delete</div><div class="ttdoc">A Health component can't be assigned.</div></div>
<div class="ttc" id="aclassBBM_1_1HealthComponent_html_ade53c57050557a4b45503b0f9d83cec9"><div class="ttname"><a href="classBBM_1_1HealthComponent.html#ade53c57050557a4b45503b0f9d83cec9">BBM::HealthComponent::HealthComponent</a></div><div class="ttdeci">HealthComponent(WAL::Entity &amp;entity, unsigned int healthPoint, const WAL::Callback&lt; WAL::Entity &amp;, WAL::Wal &amp; &gt; &amp;onDeathCallback=WAL::Callback&lt; WAL::Entity &amp;, WAL::Wal &amp; &gt;())</div><div class="ttdoc">Constructor.</div><div class="ttdef"><b>Definition:</b> HealthComponent.cpp:13</div></div>
<div class="ttc" id="aclassBBM_1_1HealthComponent_html_a7b306deb84464d098401a90d329d0e9b"><div class="ttname"><a href="classBBM_1_1HealthComponent.html#a7b306deb84464d098401a90d329d0e9b">BBM::HealthComponent::clone</a></div><div class="ttdeci">WAL::Component * clone(WAL::Entity &amp;entity) const override</div><div class="ttdoc">Clone a component for another or the same entity.</div><div class="ttdef"><b>Definition:</b> HealthComponent.cpp:19</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>