From 9ef4876c5e7de02d17785ebe7950f0edc57ae194 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 20 May 2017 00:29:04 -0400 Subject: add metadata to internal mod registry & use mod display name everywhere --- .../Framework/ModLoading/IModMetadata.cs | 39 ---------------------- .../Framework/ModLoading/ModMetadata.cs | 11 ++++++ 2 files changed, 11 insertions(+), 39 deletions(-) delete mode 100644 src/StardewModdingAPI/Framework/ModLoading/IModMetadata.cs (limited to 'src/StardewModdingAPI/Framework/ModLoading') 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 -{ - /// Metadata for a mod. - internal interface IModMetadata - { - /********* - ** Accessors - *********/ - /// The mod's display name. - string DisplayName { get; } - - /// The mod's full directory path. - string DirectoryPath { get; } - - /// The mod manifest. - IManifest Manifest { get; } - - /// Optional metadata about a mod version that SMAPI should assume is compatible or broken, regardless of whether it detects incompatible code. - ModCompatibility Compatibility { get; } - - /// The metadata resolution status. - ModMetadataStatus Status { get; } - - /// The reason the metadata is invalid, if any. - string Error { get; } - - - /********* - ** Public methods - *********/ - /// Set the mod status. - /// The metadata resolution status. - /// The reason the metadata is invalid, if any. - /// Return the instance for chaining. - 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 /// The reason the metadata is invalid, if any. public string Error { get; private set; } + /// The mod instance (if it was loaded). + public IMod Mod { get; private set; } + /********* ** Public methods @@ -53,5 +56,13 @@ namespace StardewModdingAPI.Framework.ModLoading this.Error = error; return this; } + + /// Set the mod instance. + /// The mod instance to set. + public IModMetadata SetMod(IMod mod) + { + this.Mod = mod; + return this; + } } } -- cgit