diff options
author | Dan Volchek <volchek2@illinois.edu> | 2018-06-10 15:05:59 -0700 |
---|---|---|
committer | Dan Volchek <volchek2@illinois.edu> | 2018-06-10 15:05:59 -0700 |
commit | 0b2e46d55cb09a169c7bb64ade37c82fc8233cb3 (patch) | |
tree | 63baa56fd371e92eec6b509241c0037c3b68df59 /src/SMAPI/Framework/ModLoading | |
parent | 1fa2632289134c39f268c374bb290549f28751d5 (diff) | |
download | SMAPI-0b2e46d55cb09a169c7bb64ade37c82fc8233cb3.tar.gz SMAPI-0b2e46d55cb09a169c7bb64ade37c82fc8233cb3.tar.bz2 SMAPI-0b2e46d55cb09a169c7bb64ade37c82fc8233cb3.zip |
refactor IModMetadata update info
Diffstat (limited to 'src/SMAPI/Framework/ModLoading')
-rw-r--r-- | src/SMAPI/Framework/ModLoading/ModMetadata.cs | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs index 1ead1387..88d2770c 100644 --- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs +++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using StardewModdingAPI.Framework.ModData; +using StardewModdingAPI.Framework.ModUpdateChecking; namespace StardewModdingAPI.Framework.ModLoading { @@ -43,14 +44,11 @@ namespace StardewModdingAPI.Framework.ModLoading /// <summary>The mod-provided API (if any).</summary> public object Api { get; private set; } - /// <summary>The latest version of the mod.</summary> - public ISemanticVersion LatestVersion { get; private set; } + /// <summary>The update status of this mod (if any).</summary> + public ModUpdateStatus UpdateStatus { get; private set; } - /// <summary>The latest preview version of the mod, if any.</summary> - public ISemanticVersion LatestPreviewVersion { get; private set; } - - /// <summary>The error checking for updates for this mod, if any.</summary> - public string UpdateCheckError { get; private set; } + /// <summary>The preview update status of this mod (if any).</summary> + public ModUpdateStatus PreviewUpdateStatus { get; private set; } /// <summary>Whether the mod is a content pack.</summary> public bool IsContentPack => this.Manifest?.ContentPackFor != null; @@ -124,27 +122,19 @@ namespace StardewModdingAPI.Framework.ModLoading return this; } - /// <summary>Set the update version.</summary> - /// <param name="latestVersion">The latest version.</param> - public IModMetadata SetUpdateVersion(ISemanticVersion latestVersion) - { - this.LatestVersion = latestVersion; - return this; - } - - /// <summary>Set the preview update version.</summary> - /// <param name="latestPreviewVersion">The latest preview version.</param> - public IModMetadata SetPreviewUpdateVersion(ISemanticVersion latestPreviewVersion) + /// <summary>Set the update status.</summary> + /// <param name="updateStatus">The mod update status.</param> + public IModMetadata SetUpdateStatus(ModUpdateStatus updateStatus) { - this.LatestPreviewVersion = latestPreviewVersion; + this.UpdateStatus = updateStatus; return this; } - /// <summary>Set the error that occured while checking for updates.</summary> - /// <param name="updateCheckError">The error checking for updates.</param> - public IModMetadata SetUpdateError(string updateCheckError) + /// <summary>Set the preview update status.</summary> + /// <param name="previewUpdateStatus">The mod preview update status.</param> + public IModMetadata SetPreviewUpdateStatus(ModUpdateStatus previewUpdateStatus) { - this.UpdateCheckError = updateCheckError; + this.PreviewUpdateStatus = previewUpdateStatus; return this; } |