mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-06 19:22:20 +00:00
Making bomb explose
This commit is contained in:
@@ -9,10 +9,11 @@ using namespace std::chrono_literals;
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
TimerSystem::TimerSystem()
|
||||
TimerSystem::TimerSystem(WAL::Wal &wal)
|
||||
: WAL::System({
|
||||
typeid(TimerComponent)
|
||||
})
|
||||
}),
|
||||
_wal(wal)
|
||||
{}
|
||||
|
||||
void TimerSystem::onUpdate(WAL::Entity &entity, std::chrono::nanoseconds dtime)
|
||||
@@ -21,7 +22,7 @@ namespace BBM
|
||||
timer.ringIn -= dtime;
|
||||
if (timer.ringIn <= 0ns) {
|
||||
timer.setDisable(true);
|
||||
timer.callback(entity);
|
||||
timer.callback(entity, this->_wal);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,17 +5,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <System/System.hpp>
|
||||
#include <Wal.hpp>
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
class TimerSystem : public WAL::System
|
||||
{
|
||||
private:
|
||||
//! @brief The wal engine
|
||||
WAL::Wal &_wal;
|
||||
public:
|
||||
//! @inherit
|
||||
void onUpdate(WAL::Entity &entity, std::chrono::nanoseconds dtime) override;
|
||||
|
||||
//! @brief A default constructor
|
||||
TimerSystem();
|
||||
TimerSystem(WAL::Wal &);
|
||||
//! @brief A timer system is copy constructable.
|
||||
TimerSystem(const TimerSystem &) = default;
|
||||
//! @brief A default destructor
|
||||
|
||||
Reference in New Issue
Block a user