mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 15:53:42 +00:00
29 lines
516 B
C++
29 lines
516 B
C++
#pragma once
|
|
|
|
#include "Direction.h"
|
|
#include "Component.h"
|
|
|
|
class Manager;
|
|
|
|
class HealthComponent : public Component
|
|
{
|
|
public:
|
|
|
|
HealthComponent(int health, Direction side) : health(health), side(side) {}
|
|
~HealthComponent() {}
|
|
|
|
void modifyHealth(int health = -1);
|
|
int getHealth() { return this->health; }
|
|
|
|
void init() override;
|
|
|
|
void resetHearts();
|
|
void createHeartComponents(int x);
|
|
|
|
private:
|
|
|
|
int health;
|
|
Direction side;
|
|
bool player; //true if player1 / false if player2
|
|
|
|
}; |