#nullable enable
using System.Threading;
using System.Threading.Tasks;

namespace IGP.UnitySDK.Abstractions
{
    /// <summary>
    /// Engine adapter extension contract. Implementations are discovered on the
    /// same GameObject as <see cref="IGPRuntimeManager"/>.
    /// </summary>
    public interface IIGPRuntimeExtension
    {
        int InitializationOrder { get; }

        Task<bool> InitializeAsync(
            IIGPRuntimeContext context,
            CancellationToken cancellationToken = default);

        Task ShutdownAsync(CancellationToken cancellationToken = default);
    }

    /// <summary>
    /// Core runtime services available to optional Unity SDK packages.
    /// </summary>
    public interface IIGPRuntimeContext
    {
        IGPConfig? Config { get; }
        bool IsInitialized { get; }
        CancellationToken LifetimeToken { get; }
        IIGPDesktopCommandGateway Desktop { get; }
    }
}
