mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 23:33:41 +00:00
31 lines
485 B
C++
31 lines
485 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "Direction.h"
|
|
#include "Component.h"
|
|
|
|
class Manager;
|
|
|
|
class HealthComponent : public Component
|
|
{
|
|
public:
|
|
|
|
HealthComponent(int health) : health(health) {}
|
|
~HealthComponent() {}
|
|
|
|
void modifyHealth(int health = -1);
|
|
void setHealth(int health);
|
|
int getHealth() { return this->health; }
|
|
|
|
void init() override;
|
|
|
|
void refreshHearts();
|
|
void createHeartComponents(int x);
|
|
|
|
|
|
private:
|
|
|
|
int health;
|
|
}; |