Jagguar Game Engine

Loading...
Searching...
No Matches
HealthComponent.h
1//
2// Created by gigaw on 4/4/2023.
3//
4
5#ifndef FINALPROJECT_JAGGUARS_HEALTHCOMPONENT_H
6#define FINALPROJECT_JAGGUARS_HEALTHCOMPONENT_H
7
8#include "Component.hpp"
9#include <string>
10
14 class HealthComponent : public Component {
15 public:
21 HealthComponent(int totalHealth);
22
26 ~HealthComponent();
27
28 void Update(SDL_Event r, int frame, std::vector<std::string> broadcastList) override;
29
30 void Render(SDL_Renderer *ren) override;
31
32 void ShowComponentEditor(bool* showEditor) override;
33
39 void SetHealth(int newHealth);
40
46 void UpdateHealth(int changeInHealth);
47
48 const char* ComponentTypeName() override {return "Health Component";}
49
50 private:
51 int m_totalHealth;
52 int m_currentHealth;
53
54};
55
56
57#endif //FINALPROJECT_JAGGUARS_HEALTHCOMPONENT_H
Component
Definition: Component.hpp:38
HealthComponent
Definition: HealthComponent.h:14
HealthComponent::SetHealth
void SetHealth(int newHealth)
Definition: HealthComponent.cpp:38
HealthComponent::ComponentTypeName
const char * ComponentTypeName() override
Definition: HealthComponent.h:48
HealthComponent::Render
void Render(SDL_Renderer *ren) override
Definition: HealthComponent.cpp:23
HealthComponent::UpdateHealth
void UpdateHealth(int changeInHealth)
Definition: HealthComponent.cpp:45
HealthComponent::ShowComponentEditor
void ShowComponentEditor(bool *showEditor) override
Definition: HealthComponent.cpp:27
HealthComponent::~HealthComponent
~HealthComponent()
Definition: HealthComponent.cpp:14
HealthComponent::Update
void Update(SDL_Event r, int frame, std::vector< std::string > broadcastList) override
Definition: HealthComponent.cpp:18