server-master/srcs/_plugins/Plugin.QuestImpl/QuestDependencyInjectionExtensions.cs
2026-02-10 18:21:30 +01:00

21 lines
No EOL
650 B
C#

using System;
using Microsoft.Extensions.DependencyInjection;
using PhoenixLib.Extensions;
using WingsEmu.Game.Quests;
namespace Plugin.QuestImpl
{
public static class QuestDependencyInjectionExtensions
{
public static void AddRunScriptHandlers(this IServiceCollection services)
{
Type[] types = typeof(QuestPlugin).Assembly.GetTypesImplementingInterface<IRunScriptHandler>();
foreach (Type handlerType in types)
{
services.AddTransient(handlerType);
}
services.AddSingleton<IRunScriptHandlerContainer, BaseRunScriptHandler>();
}
}
}