summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Framework/ModLoading
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-05-20 00:29:04 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-05-20 00:29:04 -0400
commit9ef4876c5e7de02d17785ebe7950f0edc57ae194 (patch)
treee9a1a16c31c57126a6dc6b2fd5526531d9a7dbfc /src/StardewModdingAPI/Framework/ModLoading
parent2781c27786739abc6f8f948e3068b0c997296524 (diff)
downloadSMAPI-9ef4876c5e7de02d17785ebe7950f0edc57ae194.tar.gz
SMAPI-9ef4876c5e7de02d17785ebe7950f0edc57ae194.tar.bz2
SMAPI-9ef4876c5e7de02d17785ebe7950f0edc57ae194.zip
add metadata to internal mod registry & use mod display name everywhere
Diffstat (limited to 'src/StardewModdingAPI/Framework/ModLoading')
-rw-r--r--src/StardewModdingAPI/Framework/ModLoading/IModMetadata.cs39
-rw-r--r--src/StardewModdingAPI/Framework/ModLoading/ModMetadata.cs11
2 files changed, 11 insertions, 39 deletions
diff --git a/src/StardewModdingAPI/Framework/ModLoading/IModMetadata.cs b/src/StardewModdingAPI/Framework/ModLoading/IModMetadata.cs
deleted file mode 100644
index 3771ffdd..00000000
--- a/src/StardewModdingAPI/Framework/ModLoading/IModMetadata.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using StardewModdingAPI.Framework.Models;
-
-namespace StardewModdingAPI.Framework.ModLoading
-{
- /// <summary>Metadata for a mod.</summary>
- internal interface IModMetadata
- {
- /*********
- ** Accessors
- *********/
- /// <summary>The mod's display name.</summary>
- string DisplayName { get; }
-
- /// <summary>The mod's full directory path.</summary>
- string DirectoryPath { get; }
-
- /// <summary>The mod manifest.</summary>
- IManifest Manifest { get; }
-
- /// <summary>Optional metadata about a mod version that SMAPI should assume is compatible or broken, regardless of whether it detects incompatible code.</summary>
- ModCompatibility Compatibility { get; }
-
- /// <summary>The metadata resolution status.</summary>
- ModMetadataStatus Status { get; }
-
- /// <summary>The reason the metadata is invalid, if any.</summary>
- string Error { get; }
-
-
- /*********
- ** Public methods
- *********/
- /// <summary>Set the mod status.</summary>
- /// <param name="status">The metadata resolution status.</param>
- /// <param name="error">The reason the metadata is invalid, if any.</param>
- /// <returns>Return the instance for chaining.</returns>
- IModMetadata SetStatus(ModMetadataStatus status, string error = null);
- }
-}
diff --git a/src/StardewModdingAPI/Framework/ModLoading/ModMetadata.cs b/src/StardewModdingAPI/Framework/ModLoading/ModMetadata.cs
index 7b25e090..ab590e10 100644
--- a/src/StardewModdingAPI/Framework/ModLoading/ModMetadata.cs
+++ b/src/StardewModdingAPI/Framework/ModLoading/ModMetadata.cs
@@ -26,6 +26,9 @@ namespace StardewModdingAPI.Framework.ModLoading
/// <summary>The reason the metadata is invalid, if any.</summary>
public string Error { get; private set; }
+ /// <summary>The mod instance (if it was loaded).</summary>
+ public IMod Mod { get; private set; }
+
/*********
** Public methods
@@ -53,5 +56,13 @@ namespace StardewModdingAPI.Framework.ModLoading
this.Error = error;
return this;
}
+
+ /// <summary>Set the mod instance.</summary>
+ /// <param name="mod">The mod instance to set.</param>
+ public IModMetadata SetMod(IMod mod)
+ {
+ this.Mod = mod;
+ return this;
+ }
}
}