// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "PlayerCore.h" #include "Templates/Function.h" namespace Electra { struct Configuration { TMap EnabledAnalyticsEvents; }; //! Initializes core service functionality. Memory hooks must have been registered before calling this function. bool Startup(const Configuration& Configuration); //! Shuts down core services. void Shutdown(); //! Waits until all player instances have terminated, which may happen asynchronously. bool WaitForAllPlayersToHaveTerminated(); void AddActivePlayerInstance(); void RemoveActivePlayerInstance(); //! Check if an analytics event is enabled bool IsAnalyticsEventEnabled(const FString& AnalyticsEventName); //! Application termination struct FApplicationTerminationHandler { TFunction Terminate; }; void AddTerminationNotificationHandler(TSharedPtrTS InHandler); void RemoveTerminationNotificationHandler(TSharedPtrTS InHandler); //! Background / foreground handling struct FFGBGNotificationHandlers { TFunction WillEnterBackground; TFunction HasEnteredForeground; }; bool AddBGFGNotificationHandler(TSharedPtrTS InHandlers); void RemoveBGFGNotificationHandler(TSharedPtrTS InHandlers); };