mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-03 10:26:29 +00:00
Trying to merge with develop
This commit is contained in:
@@ -10,15 +10,12 @@ using namespace std::chrono_literals;
|
||||
namespace BBM
|
||||
{
|
||||
TimerSystem::TimerSystem(WAL::Wal &wal)
|
||||
: WAL::System({
|
||||
typeid(TimerComponent)
|
||||
}),
|
||||
_wal(wal)
|
||||
: System(wal)
|
||||
{}
|
||||
|
||||
void TimerSystem::onUpdate(WAL::Entity &entity, std::chrono::nanoseconds dtime)
|
||||
void TimerSystem::onUpdate(WAL::ViewEntity<TimerComponent> &entity, std::chrono::nanoseconds dtime)
|
||||
{
|
||||
auto &timer = entity.getComponent<TimerComponent>();
|
||||
auto &timer = entity.get<TimerComponent>();
|
||||
timer.ringIn -= dtime;
|
||||
if (timer.ringIn <= 0ns) {
|
||||
timer.setDisable(true);
|
||||
|
||||
@@ -6,17 +6,15 @@
|
||||
|
||||
#include <System/System.hpp>
|
||||
#include <Wal.hpp>
|
||||
#include <Component/Timer/TimerComponent.hpp>
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
class TimerSystem : public WAL::System
|
||||
class TimerSystem : public WAL::System<TimerComponent>
|
||||
{
|
||||
private:
|
||||
//! @brief The wal engine
|
||||
WAL::Wal &_wal;
|
||||
public:
|
||||
//! @inherit
|
||||
void onUpdate(WAL::Entity &entity, std::chrono::nanoseconds dtime) override;
|
||||
void onUpdate(WAL::ViewEntity<TimerComponent> &entity, std::chrono::nanoseconds dtime) override;
|
||||
|
||||
//! @brief A default constructor
|
||||
TimerSystem(WAL::Wal &);
|
||||
|
||||
Reference in New Issue
Block a user