From 81433303f257b1b3c4a1820b65a9b8eccd800713 Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Tue, 31 Dec 2024 16:29:43 -0600 Subject: [PATCH] StrongInject usage --- Directory.Packages.props | 1 + Mutagen.Bethesda.Core/Archives/Archive.cs | 97 +++-- .../Environments/GameEnvironment.cs | 385 ++++++------------ .../Mutagen.Bethesda.Core.csproj | 1 + 4 files changed, 188 insertions(+), 296 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 46ee7acac..ccce15a33 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -49,6 +49,7 @@ 2.3.57 + diff --git a/Mutagen.Bethesda.Core/Archives/Archive.cs b/Mutagen.Bethesda.Core/Archives/Archive.cs index 12421f3e8..00d1b93be 100644 --- a/Mutagen.Bethesda.Core/Archives/Archive.cs +++ b/Mutagen.Bethesda.Core/Archives/Archive.cs @@ -7,10 +7,57 @@ using Mutagen.Bethesda.Installs.DI; using Mutagen.Bethesda.Plugins.Order; using Mutagen.Bethesda.Plugins.Order.DI; +using StrongInject; using Stream = System.IO.Stream; namespace Mutagen.Bethesda.Archives; +[Register(typeof(IniPathLookup), typeof(IIniPathLookup))] +[Register(typeof(IniPathProvider), typeof(IIniPathProvider))] +[Register(typeof(GetArchiveIniListings), typeof(IGetArchiveIniListings))] +[Register(typeof(CachedArchiveListingDetailsProvider), typeof(IArchiveListingDetailsProvider))] +[Register(typeof(ArchiveExtensionProvider), typeof(IArchiveExtensionProvider))] +[Register(typeof(CheckArchiveApplicability), typeof(ICheckArchiveApplicability))] +[Register(typeof(GetApplicableArchivePaths))] +partial class ArchiveContainer : IContainer +{ + [Instance] private readonly IFileSystem _fileSystem; + [Instance] private readonly IGameReleaseContext _gameReleaseContext; + [Instance] private readonly ILoadOrderListingsProvider _loadOrderListingsProvider; + [Instance] private readonly IDataDirectoryProvider _dataDirectoryProvider; + [Instance] private readonly IGameDirectoryLookup _gameDirectoryLookup = GameLocatorLookupCache.Instance; + + public ArchiveContainer( + IFileSystem fileSystem, + IGameReleaseContext GameReleaseContext, + ILoadOrderListingsProvider LoadOrderListingsProvider, + IDataDirectoryProvider DataDirectoryProvider) + { + _fileSystem = fileSystem; + _gameReleaseContext = GameReleaseContext; + _loadOrderListingsProvider = LoadOrderListingsProvider; + _dataDirectoryProvider = DataDirectoryProvider; + } +} + +[Register(typeof(IniPathLookup), typeof(IIniPathLookup))] +[Register(typeof(IniPathProvider), typeof(IIniPathProvider))] +[Register(typeof(GetArchiveIniListings))] +partial class GetArchiveIniListingsContainer : IContainer +{ + [Instance] private readonly IFileSystem _fileSystem; + [Instance] private readonly IGameReleaseContext _gameReleaseContext; + [Instance] private readonly IGameDirectoryLookup _gameDirectoryLookup = GameLocatorLookupCache.Instance; + + public GetArchiveIniListingsContainer( + IFileSystem? fileSystem, + GameRelease release) + { + _fileSystem = fileSystem.GetOrDefault(); + _gameReleaseContext = new GameReleaseInjection(release); + } +} + public static class Archive { private static GetApplicableArchivePaths GetApplicableArchivePathsDi( @@ -19,25 +66,13 @@ private static GetApplicableArchivePaths GetApplicableArchivePathsDi( IEnumerable? modOrdering, IFileSystem? fileSystem) { - fileSystem ??= fileSystem.GetOrDefault(); - var gameReleaseInjection = new GameReleaseInjection(release); - var ext = new ArchiveExtensionProvider(gameReleaseInjection); - var lo = new LoadOrderListingsInjection( - modOrdering.EmptyIfNull().Select(x => new LoadOrderListing(x, enabled: true))); - return new GetApplicableArchivePaths( - fileSystem, - new CheckArchiveApplicability( - ext), - new DataDirectoryInjection(dataFolderPath), - ext, - new CachedArchiveListingDetailsProvider( - lo, - new GetArchiveIniListings( - fileSystem, - new IniPathProvider( - new GameReleaseInjection(release), - new IniPathLookup( - GameLocatorLookupCache.Instance))))); + var cont = new ArchiveContainer( + fileSystem: fileSystem.GetOrDefault(), + new GameReleaseInjection(release), + new LoadOrderListingsInjection( + modOrdering.EmptyIfNull().Select(x => new LoadOrderListing(x, enabled: true))), + new DataDirectoryInjection(dataFolderPath)); + return cont.Resolve().Value; } /// @@ -182,12 +217,8 @@ public static bool IsApplicable(GameRelease release, ModKey modKey, FileName arc /// Any Archive ordering info retrieved from the ini definition public static IEnumerable GetIniListings(GameRelease release, IFileSystem? fileSystem = null) { - return new GetArchiveIniListings( - fileSystem.GetOrDefault(), - new IniPathProvider( - new GameReleaseInjection(release), - new IniPathLookup( - GameLocatorLookupCache.Instance))) + return new GetArchiveIniListingsContainer(fileSystem, release) + .Resolve().Value .Get(); } @@ -200,12 +231,8 @@ public static IEnumerable GetIniListings(GameRelease release, IFileSys /// Any Archive ordering info retrieved from the ini definition public static IEnumerable GetIniListings(GameRelease release, FilePath path, IFileSystem? fileSystem = null) { - return new GetArchiveIniListings( - fileSystem.GetOrDefault(), - new IniPathProvider( - new GameReleaseInjection(release), - new IniPathLookup( - GameLocatorLookupCache.Instance))) + return new GetArchiveIniListingsContainer(fileSystem, release) + .Resolve().Value .Get(path); } @@ -218,12 +245,8 @@ public static IEnumerable GetIniListings(GameRelease release, FilePath /// Any Archive ordering info retrieved from the ini definition public static IEnumerable GetIniListings(GameRelease release, Stream iniStream, IFileSystem? fileSystem = null) { - return new GetArchiveIniListings( - fileSystem.GetOrDefault(), - new IniPathProvider( - new GameReleaseInjection(release), - new IniPathLookup( - GameLocatorLookupCache.Instance))) + return new GetArchiveIniListingsContainer(fileSystem, release) + .Resolve().Value .Get(iniStream); } } \ No newline at end of file diff --git a/Mutagen.Bethesda.Core/Environments/GameEnvironment.cs b/Mutagen.Bethesda.Core/Environments/GameEnvironment.cs index a49355e4c..28b893273 100644 --- a/Mutagen.Bethesda.Core/Environments/GameEnvironment.cs +++ b/Mutagen.Bethesda.Core/Environments/GameEnvironment.cs @@ -1,3 +1,4 @@ +using System.IO.Abstractions; using Mutagen.Bethesda.Archives.DI; using Mutagen.Bethesda.Assets.DI; using Mutagen.Bethesda.Environments.DI; @@ -12,6 +13,7 @@ using Mutagen.Bethesda.Plugins.Records; using Mutagen.Bethesda.Plugins.Records.DI; using Noggog; +using StrongInject; namespace Mutagen.Bethesda.Environments; @@ -110,6 +112,61 @@ public interface IGameEnvironment : IGameEnvironment LinkCache { get; } } +[Register(typeof(ModImporter<>), typeof(IModImporter<>))] +[Register(typeof(HasEnabledMarkersProvider), typeof(IHasEnabledMarkersProvider))] +[Register(typeof(LoadOrderListingParser), typeof(ILoadOrderListingParser))] +[Register(typeof(PluginListingCommentTrimmer), typeof(IPluginListingCommentTrimmer))] +[Register(typeof(ImplicitListingModKeyProvider), typeof(IImplicitListingModKeyProvider))] +[Register(typeof(TimestampedPluginListingsPreferences), typeof(ITimestampedPluginListingsPreferences))] +[Register(typeof(PluginListingsParser), typeof(IPluginListingsParser))] +[Register(typeof(IniPathLookup), typeof(IIniPathLookup))] +[Register(typeof(PluginRawListingsReader), typeof(IPluginRawListingsReader))] +[Register(typeof(TimestampAligner), typeof(ITimestampAligner))] +[Register(typeof(TimestampedPluginListingsProvider), typeof(ITimestampedPluginListingsProvider))] +[Register(typeof(CreationClubEnabledProvider), typeof(ICreationClubEnabledProvider))] +[Register(typeof(EnabledPluginListingsProvider), typeof(IEnabledPluginListingsProvider))] +[Register(typeof(CreationClubRawListingsReader), typeof(ICreationClubRawListingsReader))] +[Register(typeof(GameCategoryContext), typeof(IGameCategoryContext))] +[Register(typeof(IniPathProvider), typeof(IIniPathProvider))] +[Register(typeof(CreationClubListingsPathProvider), typeof(ICreationClubListingsPathProvider))] +[Register(typeof(PluginListingsProvider), typeof(IPluginListingsProvider))] +[Register(typeof(ImplicitListingsProvider), typeof(IImplicitListingsProvider))] +[Register(typeof(OrderListings), typeof(IOrderListings))] +[Register(typeof(GetArchiveIniListings), typeof(IGetArchiveIniListings))] +[Register(typeof(MasterFlagsLookupProvider), typeof(IMasterFlagsLookupProvider))] +[Register(typeof(LoadOrderListingsProvider), typeof(ILoadOrderListingsProvider))] +[Register(typeof(CachedArchiveListingDetailsProvider), typeof(IArchiveListingDetailsProvider))] +[Register(typeof(ArchiveExtensionProvider), typeof(IArchiveExtensionProvider))] +[Register(typeof(CheckArchiveApplicability), typeof(ICheckArchiveApplicability))] +[Register(typeof(GetApplicableArchivePaths), typeof(IGetApplicableArchivePaths))] +[Register(typeof(PluginListingsPathProvider), typeof(IPluginListingsPathProvider))] +[Register(typeof(LoadOrderImporter<>), typeof(ILoadOrderImporter<>))] +[Register(typeof(CreationClubListingsProvider), typeof(ICreationClubListingsProvider))] +[Register(typeof(DataDirectoryAssetProvider), typeof(DataDirectoryAssetProvider))] +[Register(typeof(ArchiveAssetProvider), typeof(ArchiveAssetProvider))] +[Register(typeof(GameAssetProvider), typeof(IAssetProvider))] +[Register(typeof(PluginListingsPathContext), typeof(IPluginListingsPathContext))] +[Register(typeof(GameEnvironmentProvider<>))] +partial class GameEnvironmentProviderContainer : IContainer> + where TMod : class, IModGetter +{ + [Instance] private readonly IGameReleaseContext _release; + [Instance] private readonly IDataDirectoryProvider _dataDirectoryProvider; + [Instance] private readonly IGameDirectoryProvider _gameDirectoryProvider; + [Instance] private readonly IGameDirectoryLookup _gameDirectoryLookup; + [Instance] private readonly IFileSystem _fileSystem = IFileSystemExt.DefaultFilesystem; + + public GameEnvironmentProviderContainer( + IGameReleaseContext release, + DirectoryPath gameDir) + { + _release = release; + _dataDirectoryProvider = new DataDirectoryInjection(Path.Combine(gameDir, "Data")); + _gameDirectoryProvider = new GameDirectoryInjection(gameDir); + _gameDirectoryLookup = new GameDirectoryLookupInjection(_release.Release, gameDir.Path); + } +} + /// /// A class housing commonly used utilities when interacting with a game environment /// @@ -167,93 +224,10 @@ public static IGameEnvironment Construct( LinkCachePreferences? linkCachePrefs = null) { Warmup.Init(); - var fs = IFileSystemExt.DefaultFilesystem; - var dataDirectory = new DataDirectoryInjection(Path.Combine(gameFolder, "Data")); - var gameReleaseInjection = new GameReleaseInjection(release); - var gameDir = new GameDirectoryInjection(gameFolder); - var gameDirLookup = new GameDirectoryLookupInjection(release, gameDir.Path); - var pluginRawListingsReader = new PluginRawListingsReader( - fs, - new PluginListingsParser( - new PluginListingCommentTrimmer(), - new LoadOrderListingParser( - new HasEnabledMarkersProvider( - gameReleaseInjection)))); - var category = new GameCategoryContext(gameReleaseInjection); - var pluginListingsPathProvider = new PluginListingsPathContext( - new PluginListingsPathProvider(), - gameReleaseInjection); - var creationClubListingsPathProvider = new CreationClubListingsPathProvider( - category, - new CreationClubEnabledProvider( - category), - gameDir); - var archiveExt = new ArchiveExtensionProvider(gameReleaseInjection); - var loListingsProvider = new LoadOrderListingsProvider( - new OrderListings(), - new ImplicitListingsProvider( - IFileSystemExt.DefaultFilesystem, - dataDirectory, - new ImplicitListingModKeyProvider( - gameReleaseInjection)), - new PluginListingsProvider( - gameReleaseInjection, - new TimestampedPluginListingsProvider( - IFileSystemExt.DefaultFilesystem, - new TimestampAligner(IFileSystemExt.DefaultFilesystem), - new TimestampedPluginListingsPreferences() { ThrowOnMissingMods = false }, - pluginRawListingsReader, - dataDirectory, - pluginListingsPathProvider), - new EnabledPluginListingsProvider( - IFileSystemExt.DefaultFilesystem, - pluginRawListingsReader, - pluginListingsPathProvider)), - new CreationClubListingsProvider( - IFileSystemExt.DefaultFilesystem, - dataDirectory, - creationClubListingsPathProvider, - new CreationClubRawListingsReader())); - - var assetProvider = new GameAssetProvider( - new DataDirectoryAssetProvider( - fs, - dataDirectory), - new ArchiveAssetProvider( - fs, - new GetApplicableArchivePaths( - fs, - new CheckArchiveApplicability( - archiveExt), - dataDirectory, - archiveExt, - new CachedArchiveListingDetailsProvider( - loListingsProvider, - new GetArchiveIniListings( - fs, - new IniPathProvider( - gameReleaseInjection, - new IniPathLookup( - gameDirLookup))))), - gameReleaseInjection)); - return new GameEnvironmentProvider( - gameReleaseInjection, - new LoadOrderImporter( - IFileSystemExt.DefaultFilesystem, - dataDirectory, - loListingsProvider, - new ModImporter( - IFileSystemExt.DefaultFilesystem, - gameReleaseInjection), - new MasterFlagsLookupProvider( - gameReleaseInjection, - IFileSystemExt.DefaultFilesystem, - dataDirectory)), - dataDirectory, - pluginListingsPathProvider, - creationClubListingsPathProvider, - assetProvider) - .Construct(); + var cont = new GameEnvironmentProviderContainer( + new GameReleaseInjection(release), + gameFolder); + return cont.Resolve().Value.Construct(); } DirectoryPath IDataDirectoryProvider.Path => DataFolderPath; @@ -321,92 +295,10 @@ public static IGameEnvironment Construct( LinkCachePreferences? linkCachePrefs = null) { Warmup.Init(); - var fs = IFileSystemExt.DefaultFilesystem; - var dataDirectory = new DataDirectoryInjection(Path.Combine(gameFolder, "Data")); - var gameReleaseInjection = new GameReleaseInjection(release); - var gameDir = new GameDirectoryInjection(gameFolder); - var gameDirLookup = new GameDirectoryLookupInjection(release, gameDir.Path); - var pluginRawListingsReader = new PluginRawListingsReader( - fs, - new PluginListingsParser( - new PluginListingCommentTrimmer(), - new LoadOrderListingParser( - new HasEnabledMarkersProvider( - gameReleaseInjection)))); - var category = new GameCategoryContext(gameReleaseInjection); - var pluginListingsPathProvider = new PluginListingsPathContext( - new PluginListingsPathProvider(), - gameReleaseInjection); - var creationClubListingsPathProvider = new CreationClubListingsPathProvider( - category, - new CreationClubEnabledProvider( - category), - new GameDirectoryInjection(gameFolder)); - var loListingsProvider = new LoadOrderListingsProvider( - new OrderListings(), - new ImplicitListingsProvider( - IFileSystemExt.DefaultFilesystem, - dataDirectory, - new ImplicitListingModKeyProvider( - gameReleaseInjection)), - new PluginListingsProvider( - gameReleaseInjection, - new TimestampedPluginListingsProvider( - IFileSystemExt.DefaultFilesystem, - new TimestampAligner(IFileSystemExt.DefaultFilesystem), - new TimestampedPluginListingsPreferences() { ThrowOnMissingMods = false }, - pluginRawListingsReader, - dataDirectory, - pluginListingsPathProvider), - new EnabledPluginListingsProvider( - IFileSystemExt.DefaultFilesystem, - pluginRawListingsReader, - pluginListingsPathProvider)), - new CreationClubListingsProvider( - IFileSystemExt.DefaultFilesystem, - dataDirectory, - creationClubListingsPathProvider, - new CreationClubRawListingsReader())); - var archiveExt = new ArchiveExtensionProvider(gameReleaseInjection); - var assetProvider = new GameAssetProvider( - new DataDirectoryAssetProvider( - fs, - dataDirectory), - new ArchiveAssetProvider( - fs, - new GetApplicableArchivePaths( - fs, - new CheckArchiveApplicability( - archiveExt), - dataDirectory, - archiveExt, - new CachedArchiveListingDetailsProvider( - loListingsProvider, - new GetArchiveIniListings( - fs, - new IniPathProvider( - gameReleaseInjection, - new IniPathLookup( - gameDirLookup))))), - gameReleaseInjection)); - return new GameEnvironmentProvider( - gameReleaseInjection, - new LoadOrderImporter( - IFileSystemExt.DefaultFilesystem, - dataDirectory, - loListingsProvider, - new ModImporter( - IFileSystemExt.DefaultFilesystem, - gameReleaseInjection), - new MasterFlagsLookupProvider( - gameReleaseInjection, - IFileSystemExt.DefaultFilesystem, - dataDirectory)), - dataDirectory, - pluginListingsPathProvider, - creationClubListingsPathProvider, - assetProvider) - .Construct(); + var cont = new GameEnvironmentProviderContainer( + new GameReleaseInjection(release), + gameFolder); + return cont.Resolve().Value.Construct(); } DirectoryPath IDataDirectoryProvider.Path => DataFolderPath; @@ -418,6 +310,63 @@ public static IGameEnvironment Construct( ILoadOrderGetter> IGameEnvironment.LoadOrder => LoadOrder; } + +[Register(typeof(ModImporter<>), typeof(IModImporter<>))] +[Register(typeof(HasEnabledMarkersProvider), typeof(IHasEnabledMarkersProvider))] +[Register(typeof(LoadOrderListingParser), typeof(ILoadOrderListingParser))] +[Register(typeof(PluginListingCommentTrimmer), typeof(IPluginListingCommentTrimmer))] +[Register(typeof(ImplicitListingModKeyProvider), typeof(IImplicitListingModKeyProvider))] +[Register(typeof(TimestampedPluginListingsPreferences), typeof(ITimestampedPluginListingsPreferences))] +[Register(typeof(PluginListingsParser), typeof(IPluginListingsParser))] +[Register(typeof(IniPathLookup), typeof(IIniPathLookup))] +[Register(typeof(PluginRawListingsReader), typeof(IPluginRawListingsReader))] +[Register(typeof(TimestampAligner), typeof(ITimestampAligner))] +[Register(typeof(TimestampedPluginListingsProvider), typeof(ITimestampedPluginListingsProvider))] +[Register(typeof(CreationClubEnabledProvider), typeof(ICreationClubEnabledProvider))] +[Register(typeof(EnabledPluginListingsProvider), typeof(IEnabledPluginListingsProvider))] +[Register(typeof(CreationClubRawListingsReader), typeof(ICreationClubRawListingsReader))] +[Register(typeof(GameCategoryContext), typeof(IGameCategoryContext))] +[Register(typeof(IniPathProvider), typeof(IIniPathProvider))] +[Register(typeof(CreationClubListingsPathProvider), typeof(ICreationClubListingsPathProvider))] +[Register(typeof(PluginListingsProvider), typeof(IPluginListingsProvider))] +[Register(typeof(ImplicitListingsProvider), typeof(IImplicitListingsProvider))] +[Register(typeof(OrderListings), typeof(IOrderListings))] +[Register(typeof(GetArchiveIniListings), typeof(IGetArchiveIniListings))] +[Register(typeof(MasterFlagsLookupProvider), typeof(IMasterFlagsLookupProvider))] +[Register(typeof(LoadOrderListingsProvider), typeof(ILoadOrderListingsProvider))] +[Register(typeof(CachedArchiveListingDetailsProvider), typeof(IArchiveListingDetailsProvider))] +[Register(typeof(ArchiveExtensionProvider), typeof(IArchiveExtensionProvider))] +[Register(typeof(CheckArchiveApplicability), typeof(ICheckArchiveApplicability))] +[Register(typeof(GetApplicableArchivePaths), typeof(IGetApplicableArchivePaths))] +[Register(typeof(PluginListingsPathProvider), typeof(IPluginListingsPathProvider))] +[Register(typeof(LoadOrderImporter<>), typeof(ILoadOrderImporter<>))] +[Register(typeof(CreationClubListingsProvider), typeof(ICreationClubListingsProvider))] +[Register(typeof(DataDirectoryAssetProvider), typeof(DataDirectoryAssetProvider))] +[Register(typeof(ArchiveAssetProvider), typeof(ArchiveAssetProvider))] +[Register(typeof(GameAssetProvider), typeof(IAssetProvider))] +[Register(typeof(PluginListingsPathContext), typeof(IPluginListingsPathContext))] +[Register(typeof(GameEnvironmentProvider<,>))] +partial class GameEnvironmentProviderGenericContainer : IContainer> + where TModSetter : class, IContextMod, TModGetter + where TModGetter : class, IContextGetterMod +{ + [Instance] private readonly IGameReleaseContext _release; + [Instance] private readonly IDataDirectoryProvider _dataDirectoryProvider; + [Instance] private readonly IGameDirectoryProvider _gameDirectoryProvider; + [Instance] private readonly IGameDirectoryLookup _gameDirectoryLookup; + [Instance] private readonly IFileSystem _fileSystem = IFileSystemExt.DefaultFilesystem; + + public GameEnvironmentProviderGenericContainer( + IGameReleaseContext release, + DirectoryPath gameDir) + { + _release = release; + _dataDirectoryProvider = new DataDirectoryInjection(Path.Combine(gameDir, "Data")); + _gameDirectoryProvider = new GameDirectoryInjection(gameDir); + _gameDirectoryLookup = new GameDirectoryLookupInjection(_release.Release, gameDir.Path); + } +} + /// /// A class housing commonly used utilities when interacting with a game environment /// @@ -486,92 +435,10 @@ public static IGameEnvironment Construct( LinkCachePreferences? linkCachePrefs = null) { Warmup.Init(); - var fs = IFileSystemExt.DefaultFilesystem; - var dataDirectory = new DataDirectoryInjection(Path.Combine(gameFolder, "Data")); - var gameReleaseInjection = new GameReleaseInjection(release); - var gameDir = new GameDirectoryInjection(gameFolder); - var gameDirLookup = new GameDirectoryLookupInjection(release, gameDir.Path); - var pluginRawListingsReader = new PluginRawListingsReader( - fs, - new PluginListingsParser( - new PluginListingCommentTrimmer(), - new LoadOrderListingParser( - new HasEnabledMarkersProvider( - gameReleaseInjection)))); - var category = new GameCategoryContext(gameReleaseInjection); - var pluginListingsPathProvider = new PluginListingsPathContext( - new PluginListingsPathProvider(), - gameReleaseInjection); - var creationClubListingsPathProvider = new CreationClubListingsPathProvider( - category, - new CreationClubEnabledProvider( - category), - new GameDirectoryInjection(gameFolder)); - var loListingsProvider = new LoadOrderListingsProvider( - new OrderListings(), - new ImplicitListingsProvider( - IFileSystemExt.DefaultFilesystem, - dataDirectory, - new ImplicitListingModKeyProvider( - gameReleaseInjection)), - new PluginListingsProvider( - gameReleaseInjection, - new TimestampedPluginListingsProvider( - IFileSystemExt.DefaultFilesystem, - new TimestampAligner(IFileSystemExt.DefaultFilesystem), - new TimestampedPluginListingsPreferences() { ThrowOnMissingMods = false }, - pluginRawListingsReader, - dataDirectory, - pluginListingsPathProvider), - new EnabledPluginListingsProvider( - IFileSystemExt.DefaultFilesystem, - pluginRawListingsReader, - pluginListingsPathProvider)), - new CreationClubListingsProvider( - IFileSystemExt.DefaultFilesystem, - dataDirectory, - creationClubListingsPathProvider, - new CreationClubRawListingsReader())); - var archiveExt = new ArchiveExtensionProvider(gameReleaseInjection); - var assetProvider = new GameAssetProvider( - new DataDirectoryAssetProvider( - fs, - dataDirectory), - new ArchiveAssetProvider( - fs, - new GetApplicableArchivePaths( - fs, - new CheckArchiveApplicability( - archiveExt), - dataDirectory, - archiveExt, - new CachedArchiveListingDetailsProvider( - loListingsProvider, - new GetArchiveIniListings( - fs, - new IniPathProvider( - gameReleaseInjection, - new IniPathLookup( - gameDirLookup))))), - gameReleaseInjection)); - return new GameEnvironmentProvider( - gameReleaseInjection, - new LoadOrderImporter( - IFileSystemExt.DefaultFilesystem, - dataDirectory, - loListingsProvider, - new ModImporter( - IFileSystemExt.DefaultFilesystem, - gameReleaseInjection), - new MasterFlagsLookupProvider( - gameReleaseInjection, - IFileSystemExt.DefaultFilesystem, - dataDirectory)), - dataDirectory, - pluginListingsPathProvider, - creationClubListingsPathProvider, - assetProvider) - .Construct(); + var cont = new GameEnvironmentProviderGenericContainer( + new GameReleaseInjection(release), + gameFolder); + return cont.Resolve().Value.Construct(); } DirectoryPath IDataDirectoryProvider.Path => DataFolderPath; diff --git a/Mutagen.Bethesda.Core/Mutagen.Bethesda.Core.csproj b/Mutagen.Bethesda.Core/Mutagen.Bethesda.Core.csproj index d78da020c..2c0df0162 100644 --- a/Mutagen.Bethesda.Core/Mutagen.Bethesda.Core.csproj +++ b/Mutagen.Bethesda.Core/Mutagen.Bethesda.Core.csproj @@ -23,6 +23,7 @@ +