//
// 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 Anonymizer.Filters;
using Anonymizer.Movers;
using Anonymizer.Movers.Basic;
using Microsoft.Extensions.DependencyInjection;
using NosSmooth.Packets;
using NosSmooth.Packets.Client;
using NosSmooth.Packets.Client.Inventory;
using NosSmooth.Packets.Server.Battle;
using NosSmooth.Packets.Server.Character;
using NosSmooth.Packets.Server.Chat;
using NosSmooth.Packets.Server.Entities;
using NosSmooth.Packets.Server.Families;
using NosSmooth.Packets.Server.Groups;
using NosSmooth.Packets.Server.Inventory;
using NosSmooth.Packets.Server.Login;
using NosSmooth.Packets.Server.Maps;
using NosSmooth.Packets.Server.Raids;
using NosSmooth.Packets.Server.UI;
namespace Anonymizer.Extensions;
///
/// An extension methods for .
///
public static class ServiceCollectionExtensions
{
///
/// Adds anonymizer's , 's default implementation,
/// and basic movers (moving entity ids and names).
///
/// The service collection.
/// The same service collection.
public static IServiceCollection AddAnonymizer(this IServiceCollection serviceCollection)
=> serviceCollection
.AddSingleton()
.AddSingleton()
.AddTransient()
.AddBasicMovers();
///
/// Adds movers that move entity id and name.
///
/// The service collection.
/// The same service collection.
public static IServiceCollection AddBasicMovers(this IServiceCollection serviceCollection)
=> serviceCollection
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover()
.AddMover();
///
/// Adds movers that move players morphs, classes, sex, stats, weapons.
///
/// The service collection.
/// The same service collection.
public static IServiceCollection AddAdvancedMovers(this IServiceCollection serviceCollection)
{
return serviceCollection;
}
///
/// Add mover for the given type.
///
/// The service collection.
/// The mover type.
/// The packet type.
/// The same service collection.
public static IServiceCollection AddMover(this IServiceCollection serviceCollection)
where TMover : class, IMover
where TPacket : class, IPacket
=> serviceCollection
.Configure(rm => rm.AddMover())
.AddTransient()
.AddTransient, TMover>();
}