Skip to content

Commit

Permalink
Remove unused field
Browse files Browse the repository at this point in the history
  • Loading branch information
dymanoid committed Aug 21, 2018
1 parent 3d1decb commit c022b94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions src/RealTime/Core/Compatibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ulong, PluginManager.PluginInfo> activeMods;

private Compatibility(string modName, ILocalizationProvider localizationProvider)
private Compatibility(ILocalizationProvider localizationProvider)
{
this.modName = modName;
this.localizationProvider = localizationProvider;
activeMods = new Dictionary<ulong, PluginManager.PluginInfo>();
}

/// <summary>Initializes a new instance of the <see cref="Compatibility"/> class.</summary>
/// <param name="modName">The name of the current mod.</param>
/// <param name="localizationProvider">The localization provider to use for translation.</param>
/// <exception cref="ArgumentException">Thrown when <paramref name="modName"/> is null or an empty string.</exception>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="localizationProvider"/> is null.</exception>
/// <returns>A new and initialized instance of the <see cref="Compatibility"/> class.</returns>
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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/RealTime/Core/RealTimeMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c022b94

Please sign in to comment.