//
//  ServiceCollectionExtensions.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using NosSmooth.Core.Client;
using NosSmooth.Core.Extensions;
using NosSmooth.LocalClient.CommandHandlers;
using NosSmooth.LocalClient.CommandHandlers.Walk;
using NosSmooth.LocalClient.Hooks;
using NosSmoothCore;
namespace NosSmooth.LocalClient.Extensions;
/// 
/// Contains extension methods for .
/// 
public static class ServiceCollectionExtensions
{
    /// 
    /// Adds  along with all core dependencies.
    /// 
    /// The service collection.
    /// The collection.
    public static IServiceCollection AddLocalClient(this IServiceCollection serviceCollection)
    {
        serviceCollection.AddNostaleCore();
        serviceCollection
            .AddCommandHandler()
            .AddPacketResponder()
            .AddSingleton();
        serviceCollection.TryAddSingleton();
        serviceCollection.TryAddSingleton();
        serviceCollection.TryAddSingleton();
        serviceCollection.TryAddSingleton(p => p.GetRequiredService());
        return serviceCollection;
    }
}