summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-06-05 20:22:46 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-06-05 20:22:46 -0400
commit625c538f244519700f3942b2b2969845db9a99b0 (patch)
treed13596220a62616838310cbcf0f0004e2f843da3 /src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs
parent265ce35fd1db677230ddb16483b4d92e7c13a777 (diff)
downloadSMAPI-625c538f244519700f3942b2b2969845db9a99b0.tar.gz
SMAPI-625c538f244519700f3942b2b2969845db9a99b0.tar.bz2
SMAPI-625c538f244519700f3942b2b2969845db9a99b0.zip
move manifest parsing into toolkit (#532)
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs')
-rw-r--r--src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs b/src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs
new file mode 100644
index 00000000..12f6755b
--- /dev/null
+++ b/src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs
@@ -0,0 +1,26 @@
+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
+ )
+ { }
+ }
+}