diff options
Diffstat (limited to 'src/StardewModdingAPI/SemanticVersion.cs')
-rw-r--r-- | src/StardewModdingAPI/SemanticVersion.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/SemanticVersion.cs b/src/StardewModdingAPI/SemanticVersion.cs index 9610562f..f6bfb04d 100644 --- a/src/StardewModdingAPI/SemanticVersion.cs +++ b/src/StardewModdingAPI/SemanticVersion.cs @@ -134,6 +134,14 @@ namespace StardewModdingAPI return this.CompareTo(other) > 0; } + /// <summary>Get whether this version is between two specified versions (inclusively).</summary> + /// <param name="min">The minimum version.</param> + /// <param name="max">The maximum version.</param> + public bool IsBetween(ISemanticVersion min, ISemanticVersion max) + { + return this.CompareTo(min) >= 0 && this.CompareTo(max) <= 0; + } + /// <summary>Get a string representation of the version.</summary> public override string ToString() { |