mirror of
https://github.com/Jous99/F4MP.git
synced 2026-01-13 00:20:54 +01:00
21 lines
415 B
C++
21 lines
415 B
C++
|
|
#include <TiltedOnlinePCH.h>
|
||
|
|
|
||
|
|
#include <Services/RunnerService.h>
|
||
|
|
|
||
|
|
#include <Events/UpdateEvent.h>
|
||
|
|
|
||
|
|
RunnerService::RunnerService(entt::dispatcher& aDispatcher) noexcept
|
||
|
|
: m_dispatcher(aDispatcher)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void RunnerService::Queue(std::function<void()> aFunctor) noexcept
|
||
|
|
{
|
||
|
|
m_runner.Add(std::move(aFunctor));
|
||
|
|
}
|
||
|
|
|
||
|
|
void RunnerService::OnUpdate(const UpdateEvent& acUpdateEvent) noexcept
|
||
|
|
{
|
||
|
|
m_runner.Drain();
|
||
|
|
}
|