mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 01:34:07 +00:00
change timers to not use ptrs (#1399)
add comments as to why logic may seem confusing.
This commit is contained in:
@@ -1,22 +1,10 @@
|
||||
#include "EntityCallbackTimer.h"
|
||||
|
||||
EntityCallbackTimer::EntityCallbackTimer(float time, std::function<void()> callback) {
|
||||
EntityCallbackTimer::EntityCallbackTimer(const float time, const std::function<void()> callback) {
|
||||
m_Time = time;
|
||||
m_Callback = callback;
|
||||
}
|
||||
|
||||
EntityCallbackTimer::~EntityCallbackTimer() {
|
||||
|
||||
}
|
||||
|
||||
std::function<void()> EntityCallbackTimer::GetCallback() {
|
||||
return m_Callback;
|
||||
}
|
||||
|
||||
float EntityCallbackTimer::GetTime() {
|
||||
return m_Time;
|
||||
}
|
||||
|
||||
void EntityCallbackTimer::Update(float deltaTime) {
|
||||
m_Time -= deltaTime;
|
||||
}
|
||||
|
Reference in New Issue
Block a user