From 487ae1dce92a410984a7c13bf0f30bdd0d878aea Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 18 Dec 2016 13:52:09 -0500 Subject: add version.IsOlderThan(other) method for convenience --- src/StardewModdingAPI/Version.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') 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); } + /// Get whether this version is older than the specified version. + /// The version to compare with this instance. + public bool IsOlderThan(Version other) + { + return this.CompareTo(other) < 0; + } + /// Get whether this version is newer than the specified version. /// The version to compare with this instance. public bool IsNewerThan(Version other) -- cgit