Newer
Older
Import / projects / Gameloft / bne_lib / code / Utils / EventServiceRunner.cpp
@John John on 29 Dec 2020 740 bytes bulk import from macbookpro checkouts
#include "EventServiceRunner.h"
#include "EventSystem/EventService.h"

#include <CasualCore/CasualCore.h>
#include <CasualCore/Game.h>
#include <CasualCore/Services/ServiceManager.h>

using namespace bne;

DEFINE_SERVICE(EventServiceRunner)

bool EventServiceRunner::Initialize()
{
  return CasualService::Initialize();
}

void EventServiceRunner::Update(float time_elapsed)
{
  CasualService::Update(time_elapsed);
  EventService::GetInstance()->Update();
}

void EventServiceRunner::RegisterService()
{
  CGAME->GetServiceManager()->RegisterService(new EventServiceRunner);
}

void EventServiceRunner::UnregisterService()
{
  if(Get())
  {
    CGAME->GetServiceManager()->DeRegisterService(Get());
  }
}