Added AchievementEventHandler to AchievementManager

AchievementEventHandler simply checks which kind of event is triggered and calls the appropriate function. Its primary purpose is as a function to be pointed to.
This commit is contained in:
LillyJadeKatrin 2023-04-15 12:15:43 -04:00
parent a48fab0abf
commit ed121a4033
2 changed files with 15 additions and 0 deletions

View File

@ -202,6 +202,19 @@ void AchievementManager::ActivateDeactivateRichPresence()
nullptr, 0); nullptr, 0);
} }
void AchievementManager::AchievementEventHandler(const rc_runtime_event_t* runtime_event)
{
switch (runtime_event->type)
{
case RC_RUNTIME_EVENT_ACHIEVEMENT_TRIGGERED:
HandleAchievementTriggeredEvent(runtime_event);
break;
case RC_RUNTIME_EVENT_LBOARD_TRIGGERED:
HandleLeaderboardTriggeredEvent(runtime_event);
break;
}
}
void AchievementManager::CloseGame() void AchievementManager::CloseGame()
{ {
m_is_game_loaded = false; m_is_game_loaded = false;

View File

@ -48,6 +48,8 @@ public:
void ActivateDeactivateLeaderboards(); void ActivateDeactivateLeaderboards();
void ActivateDeactivateRichPresence(); void ActivateDeactivateRichPresence();
void AchievementEventHandler(const rc_runtime_event_t* runtime_event);
void CloseGame(); void CloseGame();
void Logout(); void Logout();
void Shutdown(); void Shutdown();