#include <HealthComponent.h>
|
|
int | m_totalHealth |
| |
|
int | m_currentHealth |
| |
|
|
std::vector< ComponentTag > | tags |
| |
|
std::vector< std::string > | previousBroadcasts |
| |
|
std::vector< std::string > | pendingBroadcasts |
| |
A Component implementation to record health for a GameObject.
◆ HealthComponent()
| HealthComponent::HealthComponent |
( |
int |
totalHealth | ) |
|
Construct a new Health Component object
- Parameters
-
| totalHealth | the maximum the GameObject's health can be |
◆ ~HealthComponent()
| HealthComponent::~HealthComponent |
( |
| ) |
|
◆ ComponentTypeName()
| const char * HealthComponent::ComponentTypeName |
( |
| ) |
|
|
inlineoverridevirtual |
◆ Render()
| void HealthComponent::Render |
( |
SDL_Renderer * |
ren | ) |
|
|
overridevirtual |
Renders the component (if it has anything to render)
- Parameters
-
| ren | the SDL renderer to be displayed upon |
- See also
- IGraphicsEngineRenderer
Reimplemented from Component.
◆ SetHealth()
| void HealthComponent::SetHealth |
( |
int |
newHealth | ) |
|
Set the current health.
- Parameters
-
| newHealth | the new health value |
◆ ShowComponentEditor()
| void HealthComponent::ShowComponentEditor |
( |
bool * |
showEditor | ) |
|
|
overridevirtual |
◆ Update()
| void HealthComponent::Update |
( |
SDL_Event |
e, |
|
|
int |
frame, |
|
|
std::vector< std::string > |
broadcastList |
|
) |
| |
|
overridevirtual |
Updates the state of the component object. Called by the Engine every tick
- Parameters
-
| e | any inputs given by the user |
| frame | what frame is the game currently displaying |
| broadcastList | a list to be used to send messages between components |
- See also
- ParseAndUpdateBroadcast()
Reimplemented from Component.
◆ UpdateHealth()
| void HealthComponent::UpdateHealth |
( |
int |
changeInHealth | ) |
|
Modify the health by the given value.
- Parameters
-
| changeInHealth | a modifier to the health value. Set it to a positive value for healing and a negative value for damaging |
The documentation for this class was generated from the following files: