first commit
This commit is contained in:
24
NitroxPatcher/Modules/NitroxPatchesModule.cs
Normal file
24
NitroxPatcher/Modules/NitroxPatchesModule.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Reflection;
|
||||
using Autofac;
|
||||
using NitroxPatcher.Patches;
|
||||
|
||||
namespace NitroxPatcher.Modules;
|
||||
|
||||
/// <summary>
|
||||
/// Simple Dependency Injection (DI) container for registering the patch classes with AutoFac.
|
||||
/// </summary>
|
||||
public class NitroxPatchesModule : Autofac.Module
|
||||
{
|
||||
protected override void Load(ContainerBuilder builder)
|
||||
{
|
||||
builder
|
||||
.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
|
||||
.AssignableTo<IPersistentPatch>()
|
||||
.AsImplementedInterfaces().SingleInstance();
|
||||
|
||||
builder
|
||||
.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
|
||||
.AssignableTo<IDynamicPatch>()
|
||||
.AsImplementedInterfaces().SingleInstance();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user