1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-09 11:47:21 -05:00
OpenDiablo2/OpenDiablo2.Core/AutofacModule.cs

30 lines
1.4 KiB
C#
Raw Normal View History

2018-11-22 00:18:42 -05:00
using Autofac;
using OpenDiablo2.Common.Interfaces;
using OpenDiablo2.Core.GameState_;
using OpenDiablo2.Core.Map_Engine;
using OpenDiablo2.Core.UI;
2018-11-22 00:18:42 -05:00
namespace OpenDiablo2.Core
{
public sealed class AutofacModule : Module
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected override void Load(ContainerBuilder builder)
{
log.Info("Configuring OpenDiablo2.Core service implementations.");
2018-11-26 18:18:23 -05:00
builder.RegisterType<Button>().As<IButton>().InstancePerDependency();
builder.RegisterType<EngineDataManager>().As<IEngineDataManager>().SingleInstance();
2018-11-22 00:18:42 -05:00
builder.RegisterType<GameEngine>().AsImplementedInterfaces().SingleInstance();
2018-11-26 18:18:23 -05:00
builder.RegisterType<GameState>().As<IGameState>().SingleInstance();
builder.RegisterType<MapEngine>().As<IMapEngine>().SingleInstance();
builder.RegisterType<MiniPanel>().As<IMiniPanel>().InstancePerDependency();
2018-11-22 00:18:42 -05:00
builder.RegisterType<MPQProvider>().As<IMPQProvider>().SingleInstance();
builder.RegisterType<ResourceManager>().As<IResourceManager>().SingleInstance();
builder.RegisterType<TextDictionary>().As<ITextDictionary>().SingleInstance();
2018-11-26 18:18:23 -05:00
builder.RegisterType<TextBox>().As<ITextBox>().InstancePerDependency();
2018-11-22 00:18:42 -05:00
}
}
}