2018-11-22 00:18:42 -05:00
|
|
|
|
using Autofac;
|
|
|
|
|
using OpenDiablo2.Common.Interfaces;
|
2018-11-23 21:56:30 -05:00
|
|
|
|
using OpenDiablo2.Core.GameState_;
|
2018-11-24 22:34:16 -05:00
|
|
|
|
using OpenDiablo2.Core.Map_Engine;
|
2018-11-22 17:00:22 -05:00
|
|
|
|
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();
|
2018-11-22 22:53:05 -05:00
|
|
|
|
builder.RegisterType<ResourceManager>().As<IResourceManager>().SingleInstance();
|
2018-11-23 16:38:21 -05:00
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|