diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-04-29 14:13:55 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-04-29 14:13:55 -0400 |
commit | 9b615fadaa3bb8fbf4fe011320aa1cc709113f3f (patch) | |
tree | 2bea5b0699288c7521ec994be992a7f4c73fa313 /src/StardewModdingAPI/Framework/ModHelper.cs | |
parent | 6b9372237c79517a44a4ce3e096634f0273f5ba3 (diff) | |
download | SMAPI-9b615fadaa3bb8fbf4fe011320aa1cc709113f3f.tar.gz SMAPI-9b615fadaa3bb8fbf4fe011320aa1cc709113f3f.tar.bz2 SMAPI-9b615fadaa3bb8fbf4fe011320aa1cc709113f3f.zip |
add initial content API (#257)
Diffstat (limited to 'src/StardewModdingAPI/Framework/ModHelper.cs')
-rw-r--r-- | src/StardewModdingAPI/Framework/ModHelper.cs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/StardewModdingAPI/Framework/ModHelper.cs b/src/StardewModdingAPI/Framework/ModHelper.cs index 52e482f2..09297a65 100644 --- a/src/StardewModdingAPI/Framework/ModHelper.cs +++ b/src/StardewModdingAPI/Framework/ModHelper.cs @@ -18,9 +18,12 @@ namespace StardewModdingAPI.Framework /********* ** Accessors *********/ - /// <summary>The mod directory path.</summary> + /// <summary>The full path to the mod's folder.</summary> public string DirectoryPath { get; } + /// <summary>An API for loading content assets.</summary> + public IContentHelper Content { get; } + /// <summary>Simplifies access to private game code.</summary> public IReflectionHelper Reflection { get; } = new ReflectionHelper(); @@ -35,14 +38,15 @@ namespace StardewModdingAPI.Framework ** Public methods *********/ /// <summary>Construct an instance.</summary> - /// <param name="modName">The friendly mod name.</param> - /// <param name="modDirectory">The mod directory path.</param> + /// <param name="manifest">The manifest for the associated mod.</param> + /// <param name="modDirectory">The full path to the mod's folder.</param> /// <param name="jsonHelper">Encapsulate SMAPI's JSON parsing.</param> /// <param name="modRegistry">Metadata about loaded mods.</param> /// <param name="commandManager">Manages console commands.</param> + /// <param name="contentManager">The content manager which loads content assets.</param> /// <exception cref="ArgumentNullException">An argument is null or empty.</exception> /// <exception cref="InvalidOperationException">The <paramref name="modDirectory"/> path does not exist on disk.</exception> - public ModHelper(string modName, string modDirectory, JsonHelper jsonHelper, IModRegistry modRegistry, CommandManager commandManager) + public ModHelper(IManifest manifest, string modDirectory, JsonHelper jsonHelper, IModRegistry modRegistry, CommandManager commandManager, SContentManager contentManager) { // validate if (string.IsNullOrWhiteSpace(modDirectory)) @@ -55,10 +59,11 @@ namespace StardewModdingAPI.Framework throw new InvalidOperationException("The specified mod directory does not exist."); // initialise - this.JsonHelper = jsonHelper; this.DirectoryPath = modDirectory; + this.JsonHelper = jsonHelper; + this.Content = new ContentHelper(contentManager, modDirectory, manifest.Name); this.ModRegistry = modRegistry; - this.ConsoleCommands = new CommandHelper(modName, commandManager); + this.ConsoleCommands = new CommandHelper(manifest.Name, commandManager); } /**** |