// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
#pragma once
#include "Engine/Core/Delegate.h"
#include "Engine/Scripting/ScriptingType.h"
class IOnlinePlatform;
///
/// The online system for communicating with various multiplayer services such as player info, achievements, game lobby or in-game store.
///
API_CLASS(Static, Namespace="FlaxEngine.Online") class FLAXENGINE_API Online
{
DECLARE_SCRIPTING_TYPE_NO_SPAWN(Online);
public:
///
/// The current online platform.
///
API_FIELD(ReadOnly) static IOnlinePlatform* Platform;
///
/// Event called when current online platform gets changed.
///
API_EVENT() static Action PlatformChanged;
public:
///
/// Initializes the online system with a given online platform implementation.
///
/// Destroys the current platform (in any already in-use).
/// The online platform object.
/// True if failed, otherwise false.
API_FUNCTION() static bool Initialize(IOnlinePlatform* platform);
};