summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Config.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-02-16 00:54:41 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-02-16 00:54:41 -0500
commit176eddbf7b70934c2665aa3a0ac8b46bef04012a (patch)
treea09c26179f2445b21bae3a79076c58839924cdb5 /src/StardewModdingAPI/Config.cs
parent2c6ab6805de0e0a21d5191838237db04aa0176ec (diff)
downloadSMAPI-176eddbf7b70934c2665aa3a0ac8b46bef04012a.tar.gz
SMAPI-176eddbf7b70934c2665aa3a0ac8b46bef04012a.tar.bz2
SMAPI-176eddbf7b70934c2665aa3a0ac8b46bef04012a.zip
make SMAPI core non-static, eliminate direct access between core components
Diffstat (limited to 'src/StardewModdingAPI/Config.cs')
-rw-r--r--src/StardewModdingAPI/Config.cs18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/StardewModdingAPI/Config.cs b/src/StardewModdingAPI/Config.cs
index 037c0fdf..f253930d 100644
--- a/src/StardewModdingAPI/Config.cs
+++ b/src/StardewModdingAPI/Config.cs
@@ -12,6 +12,13 @@ namespace StardewModdingAPI
public abstract class Config
{
/*********
+ ** Properties
+ *********/
+ /// <summary>Manages deprecation warnings.</summary>
+ private static DeprecationManager DeprecationManager;
+
+
+ /*********
** Accessors
*********/
/// <summary>The full path to the configuration file.</summary>
@@ -26,6 +33,13 @@ namespace StardewModdingAPI
/*********
** Public methods
*********/
+ /// <summary>Injects types required for backwards compatibility.</summary>
+ /// <param name="deprecationManager">Manages deprecation warnings.</param>
+ internal static void Shim(DeprecationManager deprecationManager)
+ {
+ Config.DeprecationManager = deprecationManager;
+ }
+
/// <summary>Construct an instance of the config class.</summary>
/// <typeparam name="T">The config class type.</typeparam>
[Obsolete("This base class is obsolete since SMAPI 1.0. See the latest project README for details.")]
@@ -111,8 +125,8 @@ namespace StardewModdingAPI
/// <summary>Construct an instance.</summary>
protected Config()
{
- Program.DeprecationManager.Warn("the Config class", "1.0", DeprecationLevel.Notice);
- Program.DeprecationManager.MarkWarned($"{nameof(Mod)}.{nameof(Mod.BaseConfigPath)}", "1.0"); // typically used to construct config, avoid redundant warnings
+ Config.DeprecationManager.Warn("the Config class", "1.0", DeprecationLevel.Notice);
+ Config.DeprecationManager.MarkWarned($"{nameof(Mod)}.{nameof(Mod.BaseConfigPath)}", "1.0"); // typically used to construct config, avoid redundant warnings
}
}