void takeDmg(unsigned int damage)
reduce health
Definition: HealthComponent.cpp:29
~HealthComponent() override=default
default destructor
WAL::Callback< WAL::Entity &, WAL::Wal & > onDeath
The callback invoked on this entity's death.
Definition: HealthComponent.hpp:25
Represent a single component of WAL.
Definition: Component.hpp:17
Definition: AnimationsComponent.cpp:9
An entity of the WAL's ECS.
Definition: Entity.hpp:20
void addHealthPoint(unsigned int healthPoint)
add health to the entity
Definition: HealthComponent.cpp:24
Definition: HealthComponent.hpp:16
unsigned int _healthPoint
life of an entity
Definition: HealthComponent.hpp:21
unsigned int getHealthPoint(void) const
return health point of the entity
Definition: HealthComponent.cpp:37
HealthComponent & operator=(const HealthComponent &)=delete
A Health component can't be assigned.
HealthComponent(WAL::Entity &entity, unsigned int healthPoint, const WAL::Callback< WAL::Entity &, WAL::Wal & > &onDeathCallback=WAL::Callback< WAL::Entity &, WAL::Wal & >())
Constructor.
Definition: HealthComponent.cpp:13
WAL::Component * clone(WAL::Entity &entity) const override
Clone a component for another or the same entity.
Definition: HealthComponent.cpp:19