using Insight.Remote.Shared.Models;
using Insight.Remote.Shared.Services;
using Microsoft.Extensions.DependencyInjection;
using Vaitr.Bus;

namespace Insight.Remote.Shared.Extensions;

public static class ServiceCollectionExtensions
{
    public static void AddRemoteControlServices(this IServiceCollection services, Action<AppOptions> options)
    {
        var appOptions = new AppOptions();
        options(appOptions);

        services.AddSingleton(appOptions);

        services.AddHostedService<Runtime>();
        services.AddSingleton<Streamer>();
        services.AddSingleton<Bus>();
    }
}