summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Models/SConfig.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-11-11 01:22:45 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-11-11 01:22:45 -0500
commit0629f19698c9920e2988d96f316d227f97932df8 (patch)
treed7b2d872d482179b82616fe23eaade667a776725 /src/SMAPI/Framework/Models/SConfig.cs
parent9fd8c35b462bc19efb520da21cda66f83559a66e (diff)
downloadSMAPI-0629f19698c9920e2988d96f316d227f97932df8.tar.gz
SMAPI-0629f19698c9920e2988d96f316d227f97932df8.tar.bz2
SMAPI-0629f19698c9920e2988d96f316d227f97932df8.zip
change new fields to hash sets & simplify sorting
This makes the mod IDs case-insensitive (like the 'SuppressUpdateChecks' field), fixes a build error in unit tests, and avoids re-scanning the mod list multiple times.
Diffstat (limited to 'src/SMAPI/Framework/Models/SConfig.cs')
-rw-r--r--src/SMAPI/Framework/Models/SConfig.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/SMAPI/Framework/Models/SConfig.cs b/src/SMAPI/Framework/Models/SConfig.cs
index 40d3450f..ee2dc18d 100644
--- a/src/SMAPI/Framework/Models/SConfig.cs
+++ b/src/SMAPI/Framework/Models/SConfig.cs
@@ -82,11 +82,11 @@ namespace StardewModdingAPI.Framework.Models
/// <summary>The mod IDs SMAPI should ignore when performing update checks or validating update keys.</summary>
public HashSet<string> SuppressUpdateChecks { get; set; }
- /// <summary>The mod IDs SMAPI should try to load early, before any other mods not included in this list.</summary>
- public List<string> ModsToLoadEarly { get; set; }
+ /// <summary>The mod IDs SMAPI should load before any other mods (except those needed to load them).</summary>
+ public HashSet<string> ModsToLoadEarly { get; set; }
- /// <summary>The mod IDs SMAPI should try to load late, after all other mods not included in this list.</summary>
- public List<string> ModsToLoadLate { get; set; }
+ /// <summary>The mod IDs SMAPI should load after any other mods.</summary>
+ public HashSet<string> ModsToLoadLate { get; set; }
/********
@@ -106,8 +106,8 @@ namespace StardewModdingAPI.Framework.Models
/// <param name="consoleColors">The colors to use for text written to the SMAPI console.</param>
/// <param name="suppressHarmonyDebugMode">Whether to prevent mods from enabling Harmony's debug mode, which impacts performance and creates a file on your desktop. Debug mode should never be enabled by a released mod.</param>
/// <param name="suppressUpdateChecks">The mod IDs SMAPI should ignore when performing update checks or validating update keys.</param>
- /// <param name="modsToLoadEarly">The mod IDs SMAPI should try to load early, before any other mods not included in this list.</param>
- /// <param name="modsToLoadLate">The mod IDs SMAPI should try to load late, after all other mods not included in this list.</param>
+ /// <param name="modsToLoadEarly">The mod IDs SMAPI should load before any other mods (except those needed to load them).</param>
+ /// <param name="modsToLoadLate">The mod IDs SMAPI should load after any other mods.</param>
public SConfig(bool developerMode, bool? checkForUpdates, bool? paranoidWarnings, bool? useBetaChannel, string gitHubProjectName, string webApiBaseUrl, string[]? verboseLogging, bool? rewriteMods, bool? useCaseInsensitivePaths, bool? logNetworkTraffic, ColorSchemeConfig consoleColors, bool? suppressHarmonyDebugMode, string[]? suppressUpdateChecks, string[]? modsToLoadEarly, string[]? modsToLoadLate)
{
this.DeveloperMode = developerMode;
@@ -123,8 +123,8 @@ namespace StardewModdingAPI.Framework.Models
this.ConsoleColors = consoleColors;
this.SuppressHarmonyDebugMode = suppressHarmonyDebugMode ?? (bool)SConfig.DefaultValues[nameof(this.SuppressHarmonyDebugMode)];
this.SuppressUpdateChecks = new HashSet<string>(suppressUpdateChecks ?? Array.Empty<string>(), StringComparer.OrdinalIgnoreCase);
- this.ModsToLoadEarly = new List<string>(modsToLoadEarly ?? Array.Empty<string>());
- this.ModsToLoadLate = new List<string>(modsToLoadLate ?? Array.Empty<string>());
+ this.ModsToLoadEarly = new HashSet<string>(modsToLoadEarly ?? Array.Empty<string>(), StringComparer.OrdinalIgnoreCase);
+ this.ModsToLoadLate = new HashSet<string>(modsToLoadLate ?? Array.Empty<string>(), StringComparer.OrdinalIgnoreCase);
}
/// <summary>Override the value of <see cref="DeveloperMode"/>.</summary>