From 786077340f2cea37d82455fc413535ae82a912ee Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 23 May 2020 21:55:11 -0400 Subject: refactor update check API This simplifies the logic for individual clients, centralises common logic, and prepares for upcoming features. --- .../Framework/ModRepositories/ModInfoModel.cs | 96 ---------------------- 1 file changed, 96 deletions(-) delete mode 100644 src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs (limited to 'src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs') diff --git a/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs b/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs deleted file mode 100644 index 46b98860..00000000 --- a/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs +++ /dev/null @@ -1,96 +0,0 @@ -namespace StardewModdingAPI.Web.Framework.ModRepositories -{ - /// Generic metadata about a mod. - internal class ModInfoModel - { - /********* - ** Accessors - *********/ - /// The mod name. - public string Name { get; set; } - - /// The mod's latest version. - public string Version { get; set; } - - /// The mod's latest optional or prerelease version, if newer than . - public string PreviewVersion { get; set; } - - /// The mod's web URL. - public string Url { get; set; } - - /// The license URL, if available. - public string LicenseUrl { get; set; } - - /// The license name, if available. - public string LicenseName { get; set; } - - /// The mod availability status on the remote site. - public RemoteModStatus Status { get; set; } = RemoteModStatus.Ok; - - /// The error message indicating why the mod is invalid (if applicable). - public string Error { get; set; } - - - /********* - ** Public methods - *********/ - /// Construct an empty instance. - public ModInfoModel() { } - - /// Construct an instance. - /// The mod name. - /// The semantic version for the mod's latest release. - /// The semantic version for the mod's latest preview release, if available and different from . - /// The mod's web URL. - public ModInfoModel(string name, string version, string url, string previewVersion = null) - { - this - .SetBasicInfo(name, url) - .SetVersions(version, previewVersion); - } - - /// Set the basic mod info. - /// The mod name. - /// The mod's web URL. - public ModInfoModel SetBasicInfo(string name, string url) - { - this.Name = name; - this.Url = url; - - return this; - } - - /// Set the mod version info. - /// The semantic version for the mod's latest release. - /// The semantic version for the mod's latest preview release, if available and different from . - public ModInfoModel SetVersions(string version, string previewVersion = null) - { - this.Version = version; - this.PreviewVersion = previewVersion; - - return this; - } - - /// Set the license info, if available. - /// The license URL. - /// The license name. - public ModInfoModel SetLicense(string url, string name) - { - this.LicenseUrl = url; - this.LicenseName = name; - - return this; - } - - /// Set a mod error. - /// The mod availability status on the remote site. - /// The error message indicating why the mod is invalid (if applicable). - public ModInfoModel SetError(RemoteModStatus status, string error) - { - this.Status = status; - this.Error = error; - - return this; - } - } -} -- cgit