switch to unique_ptrs for callback timers

This commit is contained in:
EmosewaMC
2023-06-14 23:16:31 -07:00
parent 83065dfb6f
commit 451f7e76d7
6 changed files with 21 additions and 35 deletions

View File

@@ -1,6 +1,6 @@
#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;
}

View File

@@ -5,7 +5,7 @@
class EntityCallbackTimer {
public:
EntityCallbackTimer(float time, std::function<void()> callback);
EntityCallbackTimer(const float& time, const std::function<void()>& callback);
~EntityCallbackTimer();
void ExecuteCallback();

View File

@@ -1,6 +1,6 @@
#include "EntityTimer.h"
EntityTimer::EntityTimer(std::string name, float time) {
EntityTimer::EntityTimer(const std::string& name, const float& time) {
m_Name = name;
m_Time = time;
}

View File

@@ -4,7 +4,7 @@
class EntityTimer {
public:
EntityTimer(std::string name, float time);
EntityTimer(const std::string& name, const float& time);
~EntityTimer();
std::string GetName();