diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-08-21 16:39:21 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-08-21 16:39:21 -0400 |
commit | 8ba54a682fd7de3756b6ddd262b232cf40d23ea0 (patch) | |
tree | 7e44d53b733d95b05b232da46306a0d3d57e9231 /src/StardewModdingAPI/Framework/Models/ModCompatibility.cs | |
parent | 674ad0d90f8780130a5fcefb3869acfe2315df2a (diff) | |
parent | eea5100acea0bceaf440f9d1bd50ee2b24cf8ebc (diff) | |
download | SMAPI-8ba54a682fd7de3756b6ddd262b232cf40d23ea0.tar.gz SMAPI-8ba54a682fd7de3756b6ddd262b232cf40d23ea0.tar.bz2 SMAPI-8ba54a682fd7de3756b6ddd262b232cf40d23ea0.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI/Framework/Models/ModCompatibility.cs')
-rw-r--r-- | src/StardewModdingAPI/Framework/Models/ModCompatibility.cs | 50 |
1 files changed, 11 insertions, 39 deletions
diff --git a/src/StardewModdingAPI/Framework/Models/ModCompatibility.cs b/src/StardewModdingAPI/Framework/Models/ModCompatibility.cs index 90cbd237..d3a9c533 100644 --- a/src/StardewModdingAPI/Framework/Models/ModCompatibility.cs +++ b/src/StardewModdingAPI/Framework/Models/ModCompatibility.cs @@ -1,5 +1,5 @@ -using System.Runtime.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using StardewModdingAPI.Framework.Serialisation; namespace StardewModdingAPI.Framework.Models { @@ -9,60 +9,32 @@ namespace StardewModdingAPI.Framework.Models /********* ** Accessors *********/ - /**** - ** From config - ****/ /// <summary>The unique mod IDs.</summary> - public string[] ID { get; set; } + [JsonConverter(typeof(SFieldConverter))] + public ModCompatibilityID[] ID { get; set; } /// <summary>The mod name.</summary> public string Name { get; set; } /// <summary>The oldest incompatible mod version, or <c>null</c> for all past versions.</summary> - public string LowerVersion { get; set; } + [JsonConverter(typeof(SFieldConverter))] + public ISemanticVersion LowerVersion { get; set; } /// <summary>The most recent incompatible mod version.</summary> - public string UpperVersion { get; set; } + [JsonConverter(typeof(SFieldConverter))] + public ISemanticVersion UpperVersion { get; set; } /// <summary>A label to show to the user instead of <see cref="UpperVersion"/>, when the manifest version differs from the user-facing version.</summary> public string UpperVersionLabel { get; set; } - /// <summary>The URL the user can check for an official updated version.</summary> - public string UpdateUrl { get; set; } - - /// <summary>The URL the user can check for an unofficial updated version.</summary> - public string UnofficialUpdateUrl { get; set; } + /// <summary>The URLs the user can check for a newer version.</summary> + public string[] UpdateUrls { get; set; } /// <summary>The reason phrase to show in the warning, or <c>null</c> to use the default value.</summary> /// <example>"this version is incompatible with the latest version of the game"</example> public string ReasonPhrase { get; set; } /// <summary>Indicates how SMAPI should consider the mod.</summary> - public ModCompatibilityType Compatibility { get; set; } - - - /**** - ** Injected - ****/ - /// <summary>The semantic version corresponding to <see cref="LowerVersion"/>.</summary> - [JsonIgnore] - public ISemanticVersion LowerSemanticVersion { get; set; } - - /// <summary>The semantic version corresponding to <see cref="UpperVersion"/>.</summary> - [JsonIgnore] - public ISemanticVersion UpperSemanticVersion { get; set; } - - - /********* - ** Private methods - *********/ - /// <summary>The method called when the model finishes deserialising.</summary> - /// <param name="context">The deserialisation context.</param> - [OnDeserialized] - private void OnDeserialized(StreamingContext context) - { - this.LowerSemanticVersion = this.LowerVersion != null ? new SemanticVersion(this.LowerVersion) : null; - this.UpperSemanticVersion = this.UpperVersion != null ? new SemanticVersion(this.UpperVersion) : null; - } + public ModCompatibilityType Compatibility { get; set; } = ModCompatibilityType.AssumeBroken; } } |