F4MP/tiltedcode/Code/client/Services/Generic/RunnerService.cpp

21 lines
415 B
C++
Raw Normal View History

#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();
}