diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-01 18:07:09 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-01 18:07:09 -0400 |
commit | 310f705f1912d0bcbf406a8d7d76fdf1347d0459 (patch) | |
tree | 026f6b4f6df7947c871ee0f3e7fcf3ccef7c4cd8 /src | |
parent | 493696690ae0c52fcd77590b1040b28ebb4cdf77 (diff) | |
download | SMAPI-310f705f1912d0bcbf406a8d7d76fdf1347d0459.tar.gz SMAPI-310f705f1912d0bcbf406a8d7d76fdf1347d0459.tar.bz2 SMAPI-310f705f1912d0bcbf406a8d7d76fdf1347d0459.zip |
format & document version class
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 +} |