diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/StardewModdingAPI/Version.cs | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/StardewModdingAPI/Version.cs b/src/StardewModdingAPI/Version.cs index 5e47a703..73bb9ef0 100644 --- a/src/StardewModdingAPI/Version.cs +++ b/src/StardewModdingAPI/Version.cs @@ -2,22 +2,44 @@ namespace StardewModdingAPI { + /// <summary>A semantic mod version with an optional build tag.</summary> public struct Version { + /********* + ** Accessors + *********/ + /// <summary>The major version incremented for major API changes.</summary> public int MajorVersion { get; set; } + + /// <summary>The minor version incremented for backwards-compatible changes.</summary> public int MinorVersion { get; set; } + + /// <summary>The patch version for backwards-compatible bug fixes.</summary> public int PatchVersion { get; set; } + + /// <summary>An optional build tag.</summary> public string Build { get; set; } + /// <summary>A string representation of the version.</summary> [JsonIgnore] public string VersionString => $"{MajorVersion}.{MinorVersion}.{PatchVersion} {Build}"; + + /********* + ** Public methods + *********/ + /// <summary>Construct an instance.</summary> + /// <param name="major">The major version incremented for major API changes.</param> + /// <param name="minor">The minor version incremented for backwards-compatible changes.</param> + /// <param name="patch">The patch version for backwards-compatible bug fixes.</param> + /// <param name="build">An optional build tag.</param> public Version(int major, int minor, int patch, string build) { - MajorVersion = major; - MinorVersion = minor; - PatchVersion = patch; - Build = build; + this.MajorVersion = major; + this.MinorVersion = minor; + this.PatchVersion = patch; + this.Build = build; + } } } -}
\ No newline at end of file +} |