diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-01-24 11:44:28 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-01-24 11:44:28 -0500 |
commit | 0da5dab8932c53ba39f2290268294e9a72b9c5bb (patch) | |
tree | 9302a2a53a68202ac97e86662394a509df499541 /src/SMAPI/Framework/LegacyManifestVersion.cs | |
parent | 15d4b6310e3dd15c62f3faedbf1290b2db26fb59 (diff) | |
parent | 5c96a10da5801049ee17ffa185dbf19e6d8a2306 (diff) | |
download | SMAPI-0da5dab8932c53ba39f2290268294e9a72b9c5bb.tar.gz SMAPI-0da5dab8932c53ba39f2290268294e9a72b9c5bb.tar.bz2 SMAPI-0da5dab8932c53ba39f2290268294e9a72b9c5bb.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/LegacyManifestVersion.cs')
-rw-r--r-- | src/SMAPI/Framework/LegacyManifestVersion.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/LegacyManifestVersion.cs b/src/SMAPI/Framework/LegacyManifestVersion.cs new file mode 100644 index 00000000..454b9137 --- /dev/null +++ b/src/SMAPI/Framework/LegacyManifestVersion.cs @@ -0,0 +1,26 @@ +using Newtonsoft.Json; + +namespace StardewModdingAPI.Framework +{ + /// <summary>An implementation of <see cref="ISemanticVersion"/> that hamdles the legacy <see cref="IManifest"/> version format.</summary> + internal 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 + ) + { } + } +} |