summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Toolkit/Serialisation/Models/LegacyManifestVersion.cs
blob: 12f6755b010f4e8248a1905b14fc43d667c7f164 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
            )
        { }
    }
}