2021-12-05 17:54:36 +00:00
|
|
|
#include "EntityCallbackTimer.h"
|
|
|
|
|
2023-06-15 06:16:31 +00:00
|
|
|
EntityCallbackTimer::EntityCallbackTimer(const float& time, const std::function<void()>& callback) {
|
2021-12-05 17:54:36 +00:00
|
|
|
m_Time = time;
|
|
|
|
m_Callback = callback;
|
|
|
|
}
|
|
|
|
|
|
|
|
EntityCallbackTimer::~EntityCallbackTimer() {
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2023-06-15 02:01:31 +00:00
|
|
|
void EntityCallbackTimer::ExecuteCallback() {
|
|
|
|
m_Callback();
|
|
|
|
}
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
std::function<void()> EntityCallbackTimer::GetCallback() {
|
|
|
|
return m_Callback;
|
|
|
|
}
|
|
|
|
|
|
|
|
float EntityCallbackTimer::GetTime() {
|
|
|
|
return m_Time;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EntityCallbackTimer::Update(float deltaTime) {
|
|
|
|
m_Time -= deltaTime;
|
|
|
|
}
|