From 8eb2f34faae31e3fe4f5379b390e421115b39757 Mon Sep 17 00:00:00 2001 From: erri120 Date: Sun, 3 Nov 2019 17:45:49 +0100 Subject: [PATCH] Updated all CompilationSteps to use the new ACompiler --- .../CompilationSteps/DeconstructBSAs.cs | 22 +++++++++---------- Wabbajack.Lib/CompilationSteps/DirectMatch.cs | 4 ++-- Wabbajack.Lib/CompilationSteps/DropAll.cs | 4 ++-- .../CompilationSteps/IgnoreDisabledMods.cs | 10 ++++----- .../CompilationSteps/IgnoreEndsWith.cs | 4 ++-- .../CompilationSteps/IgnoreGameFiles.cs | 4 ++-- .../CompilationSteps/IgnorePathContains.cs | 4 ++-- Wabbajack.Lib/CompilationSteps/IgnoreRegex.cs | 4 ++-- .../CompilationSteps/IgnoreStartsWith.cs | 4 ++-- .../IgnoreWabbajackInstallCruft.cs | 4 ++-- Wabbajack.Lib/CompilationSteps/IncludeAll.cs | 4 ++-- .../CompilationSteps/IncludeAllConfigs.cs | 4 ++-- .../CompilationSteps/IncludeDummyESPs.cs | 4 ++-- .../CompilationSteps/IncludeLOOTFiles.cs | 4 ++-- .../CompilationSteps/IncludeModIniData.cs | 4 ++-- .../CompilationSteps/IncludeOtherProfiles.cs | 6 ++--- .../CompilationSteps/IncludePatches.cs | 4 ++-- .../CompilationSteps/IncludePropertyFiles.cs | 12 +++++----- .../CompilationSteps/IncludeRegex.cs | 4 ++-- .../IncludeStubbedConfigfiles.cs | 16 +++++++------- .../CompilationSteps/IncludeTaggedMods.cs | 6 ++--- .../CompilationSteps/IncludeThisProfile.cs | 6 ++--- .../CompilationSteps/PatchStockESMs.cs | 4 ++-- .../CompilationSteps/Serialization.cs | 2 +- 24 files changed, 72 insertions(+), 72 deletions(-) diff --git a/Wabbajack.Lib/CompilationSteps/DeconstructBSAs.cs b/Wabbajack.Lib/CompilationSteps/DeconstructBSAs.cs index bc8a8e03..142fd413 100644 --- a/Wabbajack.Lib/CompilationSteps/DeconstructBSAs.cs +++ b/Wabbajack.Lib/CompilationSteps/DeconstructBSAs.cs @@ -14,9 +14,9 @@ namespace Wabbajack.Lib.CompilationSteps private readonly List _microstack; private readonly List _microstackWithInclude; - public DeconstructBSAs(Compiler compiler) : base(compiler) + public DeconstructBSAs(ACompiler compiler) : base(compiler) { - _include_directly = _compiler.ModInis.Where(kv => + _include_directly = compiler._mo2Compiler.ModInis.Where(kv => { var general = kv.Value.General; if (general.notes != null && general.notes.Contains(Consts.WABBAJACK_INCLUDE)) return true; @@ -28,16 +28,16 @@ namespace Wabbajack.Lib.CompilationSteps _microstack = new List { - new DirectMatch(_compiler), - new IncludePatches(_compiler), - new DropAll(_compiler) + new DirectMatch(compiler), + new IncludePatches(compiler._mo2Compiler), + new DropAll(compiler) }; _microstackWithInclude = new List { - new DirectMatch(_compiler), - new IncludePatches(_compiler), - new IncludeAll(_compiler) + new DirectMatch(compiler), + new IncludePatches(compiler._mo2Compiler), + new IncludeAll(compiler._mo2Compiler) }; } @@ -61,7 +61,7 @@ namespace Wabbajack.Lib.CompilationSteps var id = Guid.NewGuid().ToString(); - var matches = source_files.PMap(e => Compiler.RunStack(stack, new RawSourceFile(e) + var matches = source_files.PMap(e => _compiler.RunStack(stack, new RawSourceFile(e) { Path = Path.Combine(Consts.BSACreationDir, id, e.Paths.Last()) })); @@ -71,7 +71,7 @@ namespace Wabbajack.Lib.CompilationSteps { if (match is IgnoredDirectly) Utils.Error($"File required for BSA {source.Path} creation doesn't exist: {match.To}"); - _compiler.ExtraFiles.Add(match); + _compiler._mo2Compiler.ExtraFiles.Add(match); } CreateBSA directive; @@ -92,7 +92,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("DeconstructBSAs")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new DeconstructBSAs(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/DirectMatch.cs b/Wabbajack.Lib/CompilationSteps/DirectMatch.cs index 0b840082..289625f6 100644 --- a/Wabbajack.Lib/CompilationSteps/DirectMatch.cs +++ b/Wabbajack.Lib/CompilationSteps/DirectMatch.cs @@ -6,7 +6,7 @@ namespace Wabbajack.Lib.CompilationSteps { public class DirectMatch : ACompilationStep { - public DirectMatch(Compiler compiler) : base(compiler) + public DirectMatch(ACompiler compiler) : base(compiler) { } @@ -34,7 +34,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("DirectMatch")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new DirectMatch(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/DropAll.cs b/Wabbajack.Lib/CompilationSteps/DropAll.cs index d818be90..33ed357f 100644 --- a/Wabbajack.Lib/CompilationSteps/DropAll.cs +++ b/Wabbajack.Lib/CompilationSteps/DropAll.cs @@ -5,7 +5,7 @@ namespace Wabbajack.Lib.CompilationSteps { public class DropAll : ACompilationStep { - public DropAll(Compiler compiler) : base(compiler) + public DropAll(ACompiler compiler) : base(compiler) { } @@ -25,7 +25,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("DropAll")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new DropAll(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IgnoreDisabledMods.cs b/Wabbajack.Lib/CompilationSteps/IgnoreDisabledMods.cs index bea34d6d..c7513665 100644 --- a/Wabbajack.Lib/CompilationSteps/IgnoreDisabledMods.cs +++ b/Wabbajack.Lib/CompilationSteps/IgnoreDisabledMods.cs @@ -10,12 +10,12 @@ namespace Wabbajack.Lib.CompilationSteps { private readonly IEnumerable _allEnabledMods; - public IgnoreDisabledMods(Compiler compiler) : base(compiler) + public IgnoreDisabledMods(ACompiler compiler) : base(compiler) { - var alwaysEnabled = _compiler.ModInis.Where(f => IsAlwaysEnabled(f.Value)).Select(f => f.Key).ToHashSet(); + var alwaysEnabled = compiler._mo2Compiler.ModInis.Where(f => IsAlwaysEnabled(f.Value)).Select(f => f.Key).ToHashSet(); - _allEnabledMods = _compiler.SelectedProfiles - .SelectMany(p => File.ReadAllLines(Path.Combine(_compiler.MO2Folder, "profiles", p, "modlist.txt"))) + _allEnabledMods = compiler._mo2Compiler.SelectedProfiles + .SelectMany(p => File.ReadAllLines(Path.Combine(compiler._mo2Compiler.MO2Folder, "profiles", p, "modlist.txt"))) .Where(line => line.StartsWith("+") || line.EndsWith("_separator")) .Select(line => line.Substring(1)) .Concat(alwaysEnabled) @@ -55,7 +55,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IgnoreDisabledMods")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IgnoreDisabledMods(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IgnoreEndsWith.cs b/Wabbajack.Lib/CompilationSteps/IgnoreEndsWith.cs index 501c4b8c..966d019d 100644 --- a/Wabbajack.Lib/CompilationSteps/IgnoreEndsWith.cs +++ b/Wabbajack.Lib/CompilationSteps/IgnoreEndsWith.cs @@ -7,7 +7,7 @@ namespace Wabbajack.Lib.CompilationSteps private readonly string _postfix; private readonly string _reason; - public IgnoreEndsWith(Compiler compiler, string postfix) : base(compiler) + public IgnoreEndsWith(ACompiler compiler, string postfix) : base(compiler) { _postfix = postfix; _reason = $"Ignored because path ends with {postfix}"; @@ -40,7 +40,7 @@ namespace Wabbajack.Lib.CompilationSteps public string Postfix { get; set; } - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IgnoreEndsWith(compiler, Postfix); } diff --git a/Wabbajack.Lib/CompilationSteps/IgnoreGameFiles.cs b/Wabbajack.Lib/CompilationSteps/IgnoreGameFiles.cs index 829403fe..26e25db6 100644 --- a/Wabbajack.Lib/CompilationSteps/IgnoreGameFiles.cs +++ b/Wabbajack.Lib/CompilationSteps/IgnoreGameFiles.cs @@ -7,7 +7,7 @@ namespace Wabbajack.Lib.CompilationSteps { private readonly string _startDir; - public IgnoreGameFiles(Compiler compiler) : base(compiler) + public IgnoreGameFiles(ACompiler compiler) : base(compiler) { _startDir = Consts.GameFolderFilesDir + "\\"; } @@ -28,7 +28,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IgnoreGameFiles")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IgnoreGameFiles(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IgnorePathContains.cs b/Wabbajack.Lib/CompilationSteps/IgnorePathContains.cs index ac34717a..9b37faca 100644 --- a/Wabbajack.Lib/CompilationSteps/IgnorePathContains.cs +++ b/Wabbajack.Lib/CompilationSteps/IgnorePathContains.cs @@ -7,7 +7,7 @@ namespace Wabbajack.Lib.CompilationSteps private readonly string _pattern; private readonly string _reason; - public IgnorePathContains(Compiler compiler, string pattern) : base(compiler) + public IgnorePathContains(ACompiler compiler, string pattern) : base(compiler) { _pattern = $"\\{pattern.Trim('\\')}\\"; _reason = $"Ignored because path contains {_pattern}"; @@ -40,7 +40,7 @@ namespace Wabbajack.Lib.CompilationSteps public string Pattern { get; set; } - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IgnorePathContains(compiler, Pattern); } diff --git a/Wabbajack.Lib/CompilationSteps/IgnoreRegex.cs b/Wabbajack.Lib/CompilationSteps/IgnoreRegex.cs index 04d76386..8c4bf0f0 100644 --- a/Wabbajack.Lib/CompilationSteps/IgnoreRegex.cs +++ b/Wabbajack.Lib/CompilationSteps/IgnoreRegex.cs @@ -9,7 +9,7 @@ namespace Wabbajack.Lib.CompilationSteps private readonly Regex _regex; private readonly string _pattern; - public IgnoreRegex(Compiler compiler, string pattern) : base(compiler) + public IgnoreRegex(ACompiler compiler, string pattern) : base(compiler) { _pattern = pattern; _reason = $"Ignored because path matches regex {pattern}"; @@ -43,7 +43,7 @@ namespace Wabbajack.Lib.CompilationSteps public string Pattern { get; set; } - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IgnoreRegex(compiler, Pattern); } diff --git a/Wabbajack.Lib/CompilationSteps/IgnoreStartsWith.cs b/Wabbajack.Lib/CompilationSteps/IgnoreStartsWith.cs index a551627f..61070bc1 100644 --- a/Wabbajack.Lib/CompilationSteps/IgnoreStartsWith.cs +++ b/Wabbajack.Lib/CompilationSteps/IgnoreStartsWith.cs @@ -7,7 +7,7 @@ namespace Wabbajack.Lib.CompilationSteps private readonly string _prefix; private readonly string _reason; - public IgnoreStartsWith(Compiler compiler, string prefix) : base(compiler) + public IgnoreStartsWith(ACompiler compiler, string prefix) : base(compiler) { _prefix = prefix; _reason = string.Format("Ignored because path starts with {0}", _prefix); @@ -44,7 +44,7 @@ namespace Wabbajack.Lib.CompilationSteps public string Prefix { get; set; } - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IgnoreStartsWith(compiler, Prefix); } diff --git a/Wabbajack.Lib/CompilationSteps/IgnoreWabbajackInstallCruft.cs b/Wabbajack.Lib/CompilationSteps/IgnoreWabbajackInstallCruft.cs index 73cb13dc..d772f179 100644 --- a/Wabbajack.Lib/CompilationSteps/IgnoreWabbajackInstallCruft.cs +++ b/Wabbajack.Lib/CompilationSteps/IgnoreWabbajackInstallCruft.cs @@ -9,7 +9,7 @@ namespace Wabbajack.Lib.CompilationSteps { private readonly HashSet _cruftFiles; - public IgnoreWabbajackInstallCruft(Compiler compiler) : base(compiler) + public IgnoreWabbajackInstallCruft(ACompiler compiler) : base(compiler) { _cruftFiles = new HashSet { @@ -34,7 +34,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IgnoreWabbajackInstallCruft")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IgnoreWabbajackInstallCruft(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludeAll.cs b/Wabbajack.Lib/CompilationSteps/IncludeAll.cs index 8903d448..980ad796 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeAll.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeAll.cs @@ -5,7 +5,7 @@ namespace Wabbajack.Lib.CompilationSteps { public class IncludeAll : ACompilationStep { - public IncludeAll(Compiler compiler) : base(compiler) + public IncludeAll(ACompiler compiler) : base(compiler) { } @@ -24,7 +24,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IncludeAll")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IncludeAll(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludeAllConfigs.cs b/Wabbajack.Lib/CompilationSteps/IncludeAllConfigs.cs index 1f669666..41fe7adb 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeAllConfigs.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeAllConfigs.cs @@ -6,7 +6,7 @@ namespace Wabbajack.Lib.CompilationSteps { public class IncludeAllConfigs : ACompilationStep { - public IncludeAllConfigs(Compiler compiler) : base(compiler) + public IncludeAllConfigs(ACompiler compiler) : base(compiler) { } @@ -26,7 +26,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IncludeAllConfigs")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IncludeAllConfigs(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludeDummyESPs.cs b/Wabbajack.Lib/CompilationSteps/IncludeDummyESPs.cs index 63b0c1e8..d8fa4d0c 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeDummyESPs.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeDummyESPs.cs @@ -5,7 +5,7 @@ namespace Wabbajack.Lib.CompilationSteps { public class IncludeDummyESPs : ACompilationStep { - public IncludeDummyESPs(Compiler compiler) : base(compiler) + public IncludeDummyESPs(ACompiler compiler) : base(compiler) { } @@ -36,7 +36,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IncludeDummyESPs")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IncludeDummyESPs(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludeLOOTFiles.cs b/Wabbajack.Lib/CompilationSteps/IncludeLOOTFiles.cs index 567af7f1..342ed413 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeLOOTFiles.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeLOOTFiles.cs @@ -8,7 +8,7 @@ namespace Wabbajack.Lib.CompilationSteps { private readonly string _prefix; - public IncludeLootFiles(Compiler compiler) : base(compiler) + public IncludeLootFiles(ACompiler compiler) : base(compiler) { _prefix = Consts.LOOTFolderFilesDir + "\\"; } @@ -29,7 +29,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IncludeLootFiles")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IncludeLootFiles(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludeModIniData.cs b/Wabbajack.Lib/CompilationSteps/IncludeModIniData.cs index 101205ed..c9dbc4b3 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeModIniData.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeModIniData.cs @@ -5,7 +5,7 @@ namespace Wabbajack.Lib.CompilationSteps { public class IncludeModIniData : ACompilationStep { - public IncludeModIniData(Compiler compiler) : base(compiler) + public IncludeModIniData(ACompiler compiler) : base(compiler) { } @@ -25,7 +25,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IncludeModIniData")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IncludeModIniData(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludeOtherProfiles.cs b/Wabbajack.Lib/CompilationSteps/IncludeOtherProfiles.cs index 82442db7..f9dec58c 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeOtherProfiles.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeOtherProfiles.cs @@ -9,9 +9,9 @@ namespace Wabbajack.Lib.CompilationSteps { private readonly IEnumerable _profiles; - public IgnoreOtherProfiles(Compiler compiler) : base(compiler) + public IgnoreOtherProfiles(ACompiler compiler) : base(compiler) { - _profiles = _compiler.SelectedProfiles + _profiles = compiler._mo2Compiler.SelectedProfiles .Select(p => Path.Combine("profiles", p) + "\\") .ToList(); } @@ -33,7 +33,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IgnoreOtherProfiles")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IgnoreOtherProfiles(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludePatches.cs b/Wabbajack.Lib/CompilationSteps/IncludePatches.cs index 71c4fd44..a4a6e9c4 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludePatches.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludePatches.cs @@ -11,7 +11,7 @@ namespace Wabbajack.Lib.CompilationSteps { private readonly Dictionary> _indexed; - public IncludePatches(Compiler compiler) : base(compiler) + public IncludePatches(ACompiler compiler) : base(compiler) { _indexed = _compiler.IndexedFiles.Values .SelectMany(f => f) @@ -47,7 +47,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IncludePatches")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IncludePatches(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludePropertyFiles.cs b/Wabbajack.Lib/CompilationSteps/IncludePropertyFiles.cs index dfa7f607..ce7bedd9 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludePropertyFiles.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludePropertyFiles.cs @@ -7,7 +7,7 @@ namespace Wabbajack.Lib.CompilationSteps { public class IncludePropertyFiles : ACompilationStep { - public IncludePropertyFiles(Compiler compiler) : base(compiler) + public IncludePropertyFiles(ACompiler compiler) : base(compiler) { } @@ -15,23 +15,23 @@ namespace Wabbajack.Lib.CompilationSteps { var files = new HashSet { - _compiler.ModListImage, _compiler.ModListReadme + _compiler._mo2Compiler.ModListImage, _compiler._mo2Compiler.ModListReadme }; if (!files.Any(f => source.AbsolutePath.Equals(f))) return null; if (!File.Exists(source.AbsolutePath)) return null; - var isBanner = source.AbsolutePath == _compiler.ModListImage; + var isBanner = source.AbsolutePath == _compiler._mo2Compiler.ModListImage; //var isReadme = source.AbsolutePath == ModListReadme; var result = source.EvolveTo(); result.SourceDataID = _compiler.IncludeFile(File.ReadAllBytes(source.AbsolutePath)); if (isBanner) { result.Type = PropertyType.Banner; - _compiler.ModListImage = result.SourceDataID; + _compiler._mo2Compiler.ModListImage = result.SourceDataID; } else { result.Type = PropertyType.Readme; - _compiler.ModListReadme = result.SourceDataID; + _compiler._mo2Compiler.ModListReadme = result.SourceDataID; } return result; @@ -45,7 +45,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IncludePropertyFiles")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IncludePropertyFiles(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludeRegex.cs b/Wabbajack.Lib/CompilationSteps/IncludeRegex.cs index e53c4875..7f806981 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeRegex.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeRegex.cs @@ -9,7 +9,7 @@ namespace Wabbajack.Lib.CompilationSteps private readonly string _pattern; private readonly Regex _regex; - public IncludeRegex(Compiler compiler, string pattern) : base(compiler) + public IncludeRegex(ACompiler compiler, string pattern) : base(compiler) { _pattern = pattern; _regex = new Regex(pattern); @@ -43,7 +43,7 @@ namespace Wabbajack.Lib.CompilationSteps public string Pattern { get; set; } - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IncludeRegex(compiler, Pattern); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludeStubbedConfigfiles.cs b/Wabbajack.Lib/CompilationSteps/IncludeStubbedConfigfiles.cs index a5cede88..b75c5b95 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeStubbedConfigfiles.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeStubbedConfigfiles.cs @@ -7,7 +7,7 @@ namespace Wabbajack.Lib.CompilationSteps { public class IncludeStubbedConfigFiles : ACompilationStep { - public IncludeStubbedConfigFiles(Compiler compiler) : base(compiler) + public IncludeStubbedConfigFiles(ACompiler compiler) : base(compiler) { } @@ -30,14 +30,14 @@ namespace Wabbajack.Lib.CompilationSteps data = data.Replace(_compiler.GamePath.Replace("\\", "\\\\"), Consts.GAME_PATH_MAGIC_DOUBLE_BACK); data = data.Replace(_compiler.GamePath.Replace("\\", "/"), Consts.GAME_PATH_MAGIC_FORWARD); - data = data.Replace(_compiler.MO2Folder, Consts.MO2_PATH_MAGIC_BACK); - data = data.Replace(_compiler.MO2Folder.Replace("\\", "\\\\"), Consts.MO2_PATH_MAGIC_DOUBLE_BACK); - data = data.Replace(_compiler.MO2Folder.Replace("\\", "/"), Consts.MO2_PATH_MAGIC_FORWARD); + data = data.Replace(_compiler._mo2Compiler.MO2Folder, Consts.MO2_PATH_MAGIC_BACK); + data = data.Replace(_compiler._mo2Compiler.MO2Folder.Replace("\\", "\\\\"), Consts.MO2_PATH_MAGIC_DOUBLE_BACK); + data = data.Replace(_compiler._mo2Compiler.MO2Folder.Replace("\\", "/"), Consts.MO2_PATH_MAGIC_FORWARD); - data = data.Replace(_compiler.MO2DownloadsFolder, Consts.DOWNLOAD_PATH_MAGIC_BACK); - data = data.Replace(_compiler.MO2DownloadsFolder.Replace("\\", "\\\\"), + data = data.Replace(_compiler._mo2Compiler.MO2DownloadsFolder, Consts.DOWNLOAD_PATH_MAGIC_BACK); + data = data.Replace(_compiler._mo2Compiler.MO2DownloadsFolder.Replace("\\", "\\\\"), Consts.DOWNLOAD_PATH_MAGIC_DOUBLE_BACK); - data = data.Replace(_compiler.MO2DownloadsFolder.Replace("\\", "/"), Consts.DOWNLOAD_PATH_MAGIC_FORWARD); + data = data.Replace(_compiler._mo2Compiler.MO2DownloadsFolder.Replace("\\", "/"), Consts.DOWNLOAD_PATH_MAGIC_FORWARD); if (data == originalData) return null; @@ -49,7 +49,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IncludeStubbedConfigFiles")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IncludeStubbedConfigFiles(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludeTaggedMods.cs b/Wabbajack.Lib/CompilationSteps/IncludeTaggedMods.cs index ea1a8cd6..f6304f56 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeTaggedMods.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeTaggedMods.cs @@ -11,10 +11,10 @@ namespace Wabbajack.Lib.CompilationSteps private readonly string _tag; - public IncludeTaggedMods(Compiler compiler, string tag) : base(compiler) + public IncludeTaggedMods(ACompiler compiler, string tag) : base(compiler) { _tag = tag; - _includeDirectly = _compiler.ModInis.Where(kv => + _includeDirectly = compiler._mo2Compiler.ModInis.Where(kv => { var general = kv.Value.General; if (general.notes != null && general.notes.Contains(_tag)) @@ -56,7 +56,7 @@ namespace Wabbajack.Lib.CompilationSteps public string Tag { get; set; } - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IncludeTaggedMods(compiler, Tag); } diff --git a/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs b/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs index d1c97e39..f5ca2515 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs @@ -10,9 +10,9 @@ namespace Wabbajack.Lib.CompilationSteps { private readonly IEnumerable _correctProfiles; - public IncludeThisProfile(Compiler compiler) : base(compiler) + public IncludeThisProfile(ACompiler compiler) : base(compiler) { - _correctProfiles = _compiler.SelectedProfiles.Select(p => Path.Combine("profiles", p) + "\\").ToList(); + _correctProfiles = compiler._mo2Compiler.SelectedProfiles.Select(p => Path.Combine("profiles", p) + "\\").ToList(); } public override Directive Run(RawSourceFile source) @@ -48,7 +48,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("IncludeThisProfile")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new IncludeThisProfile(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/PatchStockESMs.cs b/Wabbajack.Lib/CompilationSteps/PatchStockESMs.cs index 521ff6d4..58338899 100644 --- a/Wabbajack.Lib/CompilationSteps/PatchStockESMs.cs +++ b/Wabbajack.Lib/CompilationSteps/PatchStockESMs.cs @@ -8,7 +8,7 @@ namespace Wabbajack.Lib.CompilationSteps { public class PatchStockESMs : ACompilationStep { - public PatchStockESMs(Compiler compiler) : base(compiler) + public PatchStockESMs(ACompiler compiler) : base(compiler) { } @@ -44,7 +44,7 @@ namespace Wabbajack.Lib.CompilationSteps [JsonObject("PatchStockESMs")] public class State : IState { - public ICompilationStep CreateStep(Compiler compiler) + public ICompilationStep CreateStep(ACompiler compiler) { return new PatchStockESMs(compiler); } diff --git a/Wabbajack.Lib/CompilationSteps/Serialization.cs b/Wabbajack.Lib/CompilationSteps/Serialization.cs index e601cf5d..2aff7668 100644 --- a/Wabbajack.Lib/CompilationSteps/Serialization.cs +++ b/Wabbajack.Lib/CompilationSteps/Serialization.cs @@ -13,7 +13,7 @@ namespace Wabbajack.Lib.CompilationSteps .ToJSON(TypeNameHandling.Auto, TypeNameAssemblyFormatHandling.Simple); } - public static List Deserialize(string stack, Compiler compiler) + public static List Deserialize(string stack, ACompiler compiler) { return stack.FromJSONString>(TypeNameHandling.Auto, TypeNameAssemblyFormatHandling.Simple) .Select(s => s.CreateStep(compiler)).ToList();