From 0b2e46d55cb09a169c7bb64ade37c82fc8233cb3 Mon Sep 17 00:00:00 2001 From: Dan Volchek Date: Sun, 10 Jun 2018 15:05:59 -0700 Subject: refactor IModMetadata update info --- src/SMAPI/Framework/ModLoading/ModMetadata.cs | 36 ++++++++++----------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'src/SMAPI/Framework/ModLoading') 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 /// The mod-provided API (if any). public object Api { get; private set; } - /// The latest version of the mod. - public ISemanticVersion LatestVersion { get; private set; } + /// The update status of this mod (if any). + public ModUpdateStatus UpdateStatus { get; private set; } - /// The latest preview version of the mod, if any. - public ISemanticVersion LatestPreviewVersion { get; private set; } - - /// The error checking for updates for this mod, if any. - public string UpdateCheckError { get; private set; } + /// The preview update status of this mod (if any). + public ModUpdateStatus PreviewUpdateStatus { get; private set; } /// Whether the mod is a content pack. public bool IsContentPack => this.Manifest?.ContentPackFor != null; @@ -124,27 +122,19 @@ namespace StardewModdingAPI.Framework.ModLoading return this; } - /// Set the update version. - /// The latest version. - public IModMetadata SetUpdateVersion(ISemanticVersion latestVersion) - { - this.LatestVersion = latestVersion; - return this; - } - - /// Set the preview update version. - /// The latest preview version. - public IModMetadata SetPreviewUpdateVersion(ISemanticVersion latestPreviewVersion) + /// Set the update status. + /// The mod update status. + public IModMetadata SetUpdateStatus(ModUpdateStatus updateStatus) { - this.LatestPreviewVersion = latestPreviewVersion; + this.UpdateStatus = updateStatus; return this; } - /// Set the error that occured while checking for updates. - /// The error checking for updates. - public IModMetadata SetUpdateError(string updateCheckError) + /// Set the preview update status. + /// The mod preview update status. + public IModMetadata SetPreviewUpdateStatus(ModUpdateStatus previewUpdateStatus) { - this.UpdateCheckError = updateCheckError; + this.PreviewUpdateStatus = previewUpdateStatus; return this; } -- cgit