mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-06 05:12:09 +00:00
Merging game
This commit is contained in:
25
sources/System/Health/HealthSystem.cpp
Normal file
25
sources/System/Health/HealthSystem.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Tom Augier on 2021-05-20.
|
||||
// Edited by Benjamin Henry on 2021-05-20.
|
||||
//
|
||||
|
||||
#include "HealthSystem.hpp"
|
||||
#include "sources/Component/Health/HealthComponent.hpp"
|
||||
#include "sources/Component/Controllable/ControllableComponent.hpp"
|
||||
#include "lib/wal/sources/Entity/Entity.hpp"
|
||||
|
||||
namespace Bomberman
|
||||
{
|
||||
const std::type_info &HealthSystem::getComponent() const
|
||||
{
|
||||
return typeid(HealthComponent);
|
||||
}
|
||||
|
||||
void HealthSystem::onFixedUpdate(WAL::Entity &entity)
|
||||
{
|
||||
auto &health = entity.getComponent<HealthComponent>();
|
||||
|
||||
if (health.getHealthPoint() == 0);
|
||||
entity.setDisable(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user