2018-11-22 00:18:42 -05:00
|
|
|
|
using Autofac;
|
|
|
|
|
using OpenDiablo2.Common.Interfaces;
|
2018-12-07 18:45:54 -05:00
|
|
|
|
using OpenDiablo2.Common.Interfaces.Drawing;
|
2018-12-01 02:44:40 -05:00
|
|
|
|
using OpenDiablo2.Common.Interfaces.Mobs;
|
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-12-02 16:34:00 -05:00
|
|
|
|
builder.RegisterType<ItemManager>().As<IItemManager>().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-29 19:11:25 -05:00
|
|
|
|
builder.RegisterType<PanelFrame>().As<IPanelFrame>().InstancePerDependency();
|
2018-12-07 18:45:23 -05:00
|
|
|
|
builder.RegisterType<CharacterPanel>().AsImplementedInterfaces().InstancePerDependency();
|
|
|
|
|
builder.RegisterType<InventoryPanel>().AsImplementedInterfaces().InstancePerDependency();
|
2018-12-02 16:34:00 -05:00
|
|
|
|
builder.RegisterType<ItemContainer>().As<IItemContainer>().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-12-01 02:44:40 -05:00
|
|
|
|
builder.RegisterType<MobManager>().As<IMobManager>().SingleInstance(); // TODO: This needs to have client and server versions...
|
2018-11-22 00:18:42 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|