From c022b949137ce8915e8ee80d3646847a71498d72 Mon Sep 17 00:00:00 2001 From: dymanoid <9433345+dymanoid@users.noreply.github.com> Date: Tue, 21 Aug 2018 21:47:36 +0200 Subject: [PATCH] Remove unused field --- src/RealTime/Core/Compatibility.cs | 15 +++------------ src/RealTime/Core/RealTimeMod.cs | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/RealTime/Core/Compatibility.cs b/src/RealTime/Core/Compatibility.cs index 59764f30..a768f3d4 100644 --- a/src/RealTime/Core/Compatibility.cs +++ b/src/RealTime/Core/Compatibility.cs @@ -27,31 +27,22 @@ internal sealed class Compatibility 1181352643, // District Service Limit 3.0 }; - private readonly string modName; private readonly ILocalizationProvider localizationProvider; private readonly Dictionary activeMods; - private Compatibility(string modName, ILocalizationProvider localizationProvider) + private Compatibility(ILocalizationProvider localizationProvider) { - this.modName = modName; this.localizationProvider = localizationProvider; activeMods = new Dictionary(); } /// Initializes a new instance of the class. - /// The name of the current mod. /// The localization provider to use for translation. - /// Thrown when is null or an empty string. /// Thrown when is null. /// A new and initialized instance of the class. - public static Compatibility Create(string modName, ILocalizationProvider localizationProvider) + public static Compatibility Create(ILocalizationProvider localizationProvider) { - if (string.IsNullOrEmpty(modName)) - { - throw new ArgumentException("The mod name cannot be null or an empty string", nameof(modName)); - } - - var result = new Compatibility(modName, localizationProvider ?? throw new ArgumentNullException(nameof(localizationProvider))); + var result = new Compatibility(localizationProvider ?? throw new ArgumentNullException(nameof(localizationProvider))); result.Initialize(); return result; } diff --git a/src/RealTime/Core/RealTimeMod.cs b/src/RealTime/Core/RealTimeMod.cs index ed37baca..0dcaafb8 100644 --- a/src/RealTime/Core/RealTimeMod.cs +++ b/src/RealTime/Core/RealTimeMod.cs @@ -139,7 +139,7 @@ public override void OnLevelLoaded(LoadMode mode) Log.Info($"The 'Real Time' mod starts, game mode {mode}."); core?.Stop(); - var compatibility = Compatibility.Create(Name, localizationProvider); + var compatibility = Compatibility.Create(localizationProvider); bool isNewGame = mode == LoadMode.NewGame || mode == LoadMode.NewGameFromScenario; core = RealTimeCore.Run(configProvider, modPath, localizationProvider, isNewGame, compatibility);