mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 23:33:41 +00:00
29 lines
538 B
C++
29 lines
538 B
C++
#pragma once
|
|
|
|
#include "Component.h"
|
|
|
|
class Manager;
|
|
|
|
class HealthComponent : public Component
|
|
{
|
|
public:
|
|
|
|
HealthComponent(int health, Manager* manager, bool player) : health(health), manager(manager), player(player) {}
|
|
~HealthComponent() {}
|
|
|
|
void getDamage() { this->health--; }
|
|
int getHealth() { return this->health; }
|
|
|
|
void init() override;
|
|
|
|
void createAllHearts();
|
|
void createHeartComponents(int x);
|
|
|
|
|
|
private:
|
|
|
|
int health;
|
|
Manager* manager;
|
|
bool player; //true if player1 / false if player2
|
|
|
|
}; |