diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-12-18 13:52:09 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-12-18 13:52:09 -0500 |
commit | 487ae1dce92a410984a7c13bf0f30bdd0d878aea (patch) | |
tree | 00d3335b14972b6d909043707d813dc4a86b9e52 /src | |
parent | db6b204a1c1c9a057fb0679bca37c0b2b074f1d4 (diff) | |
download | SMAPI-487ae1dce92a410984a7c13bf0f30bdd0d878aea.tar.gz SMAPI-487ae1dce92a410984a7c13bf0f30bdd0d878aea.tar.bz2 SMAPI-487ae1dce92a410984a7c13bf0f30bdd0d878aea.zip |
add version.IsOlderThan(other) method for convenience
Diffstat (limited to 'src')
-rw-r--r-- | src/StardewModdingAPI/Version.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Version.cs b/src/StardewModdingAPI/Version.cs index bdecc8e0..7c6d319c 100644 --- a/src/StardewModdingAPI/Version.cs +++ b/src/StardewModdingAPI/Version.cs @@ -98,6 +98,13 @@ namespace StardewModdingAPI return string.Compare(this.ToString(), other.ToString(), StringComparison.InvariantCultureIgnoreCase); } + /// <summary>Get whether this version is older than the specified version.</summary> + /// <param name="other">The version to compare with this instance.</param> + public bool IsOlderThan(Version other) + { + return this.CompareTo(other) < 0; + } + /// <summary>Get whether this version is newer than the specified version.</summary> /// <param name="other">The version to compare with this instance.</param> public bool IsNewerThan(Version other) |