SDL Minigame
1.0
Loading...
Searching...
No Matches
HealthComponent.h
1
#pragma once
2
3
#include "Direction.h"
4
#include "Component.h"
5
6
class
Manager
;
7
8
class
HealthComponent
:
public
Component
9
{
10
public
:
11
12
HealthComponent
(
int
health, Direction side) : health(health), side(side) {}
13
~HealthComponent
() {}
14
15
void
modifyHealth(
int
health = -1);
16
void
setHealth(
int
health);
17
int
getHealth() {
return
this->health; }
18
19
void
init()
override
;
20
21
void
refreshHearts();
22
void
createHeartComponents(
int
x);
23
24
25
private
:
26
27
int
health;
28
Direction side;
29
};
Component
Definition
Component.h:6
HealthComponent
Definition
HealthComponent.h:9
Manager
Is responsible for managing all entities.
Definition
Manager.h:20
include
HealthComponent.h
Generated by
1.10.0