server-master/srcs/_plugins/WingsEmu.Plugins.BasicImplementation/ServiceCollectionExtensions.cs
2026-02-10 18:21:30 +01:00

20 lines
No EOL
589 B
C#

using System;
using Microsoft.Extensions.DependencyInjection;
using PhoenixLib.Extensions;
using WingsEmu.Game._Guri;
namespace WingsEmu.Plugins.BasicImplementations;
public static class ServiceCollectionExtensions
{
public static void AddGuriHandlers(this IServiceCollection services)
{
Type[] types = typeof(GuriPlugin).Assembly.GetTypesImplementingInterface<IGuriHandler>();
foreach (Type handlerType in types)
{
services.AddTransient(handlerType);
}
services.AddSingleton<IGuriHandlerContainer, BaseGuriHandler>();
}
}