The Table Engine
health.h
Go to the documentation of this file.
1 #pragma once
2 #include "component.h"
3 
22 class Health : public Component {
23  private:
25 
26  public:
30  Health();
31  Health(int health);
32 
36  ~Health();
37 
42  int getHealth();
43 
48  void updateHealth(int amount);
49 };
Base class for all game components, providing basic component functionalities.
Definition: component.h:25
A component for managing health of game objects.
Definition: health.h:22
~Health()
Destructor for the health component.
Definition: health.cpp:13
int m_currentHealth
Current health of the game object.
Definition: health.h:24
Health()
Constructor that initializes the health component.
Definition: health.cpp:5
int getHealth()
Retrieves the current health of the game object.
Definition: health.cpp:21
void updateHealth(int amount)
Updates the health by a specified amount.
Definition: health.cpp:17
Defines the Component base class for all components in the game engine.