From a3ade7a5126642f42794281057349fa5ff737cdd Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 13 Apr 2018 22:41:34 -0400 Subject: split mod DB into a separate file The mod metadata has grown over time, and there's no need to keep it in memory after mod loading. This lets us load the config earlier (since it has a smaller impact on memory usage which affects the game's audio code), and lets us discard the mod metadata when we're done with it. --- src/SMAPI/Framework/Models/SConfig.cs | 6 ------ src/SMAPI/Framework/Models/SMetadata.cs | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 src/SMAPI/Framework/Models/SMetadata.cs (limited to 'src/SMAPI/Framework/Models') diff --git a/src/SMAPI/Framework/Models/SConfig.cs b/src/SMAPI/Framework/Models/SConfig.cs index 17169714..2d6da0fa 100644 --- a/src/SMAPI/Framework/Models/SConfig.cs +++ b/src/SMAPI/Framework/Models/SConfig.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using StardewModdingAPI.Framework.ModData; - namespace StardewModdingAPI.Framework.Models { /// The SMAPI configuration settings. @@ -23,8 +20,5 @@ namespace StardewModdingAPI.Framework.Models /// Whether SMAPI should log more information about the game context. public bool VerboseLogging { get; set; } - - /// Extra metadata about mods. - public IDictionary ModData { get; set; } } } diff --git a/src/SMAPI/Framework/Models/SMetadata.cs b/src/SMAPI/Framework/Models/SMetadata.cs new file mode 100644 index 00000000..9ff495e9 --- /dev/null +++ b/src/SMAPI/Framework/Models/SMetadata.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using StardewModdingAPI.Framework.ModData; + +namespace StardewModdingAPI.Framework.Models +{ + /// The SMAPI predefined metadata. + internal class SMetadata + { + /******** + ** Accessors + ********/ + /// Extra metadata about mods. + public IDictionary ModData { get; set; } + } +} -- cgit