diff options
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Serialisation')
-rw-r--r-- | src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs | 5 | ||||
-rw-r--r-- | src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs | 26 |
2 files changed, 4 insertions, 27 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs b/src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs index 2075d27e..2ddaa1bf 100644 --- a/src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs +++ b/src/StardewModdingAPI.Toolkit/Serialisation/Converters/SemanticVersionConverter.cs @@ -18,7 +18,10 @@ namespace StardewModdingAPI.Toolkit.Serialisation.Converters int minor = obj.ValueIgnoreCase<int>("MinorVersion"); int patch = obj.ValueIgnoreCase<int>("PatchVersion"); string build = obj.ValueIgnoreCase<string>("Build"); - return new LegacyManifestVersion(major, minor, patch, build); + if (build == "0") + build = null; // '0' from incorrect examples in old SMAPI documentation + + return new SemanticVersion(major, minor, patch, build); } /// <summary>Read a JSON string.</summary> diff --git a/src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs b/src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs deleted file mode 100644 index 12f6755b..00000000 --- a/src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Newtonsoft.Json; - -namespace StardewModdingAPI.Toolkit.Serialisation.Models -{ - /// <summary>An implementation of <see cref="ISemanticVersion"/> that hamdles the legacy <see cref="Manifest"/> version format.</summary> - public class LegacyManifestVersion : SemanticVersion - { - /********* - ** Public methods - *********/ - /// <summary>Construct an instance.</summary> - /// <param name="majorVersion">The major version incremented for major API changes.</param> - /// <param name="minorVersion">The minor version incremented for backwards-compatible changes.</param> - /// <param name="patchVersion">The patch version for backwards-compatible bug fixes.</param> - /// <param name="build">An optional build tag.</param> - [JsonConstructor] - public LegacyManifestVersion(int majorVersion, int minorVersion, int patchVersion, string build = null) - : base( - majorVersion, - minorVersion, - patchVersion, - build != "0" ? build : null // '0' from incorrect examples in old SMAPI documentation - ) - { } - } -} |