//
// 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 NosSmooth.LocalBinding.Objects;
namespace NosSmooth.LocalBinding.Extensions;
///
/// Contains extension methods for .
///
public static class ServiceCollectionExtensions
{
///
/// Adds bindings to Nostale objects along with to initialize those.
///
///
/// Adds and .
/// You have to initialize these using
/// prior to requesting them from the provider, otherwise an exception
/// will be thrown.
///
/// The service collection.
/// The collection.
public static IServiceCollection AddNostaleBindings(this IServiceCollection serviceCollection)
{
return serviceCollection
.AddSingleton()
.AddSingleton(p => p.GetRequiredService().PlayerManager)
.AddSingleton(p => p.GetRequiredService().SceneManager)
.AddSingleton(p => p.GetRequiredService().Network);
}
}