add version.IsBetween method (#263)
This commit is contained in:
parent
01917e70a2
commit
5ff3184c30
|
@ -32,6 +32,11 @@ namespace StardewModdingAPI
|
||||||
/// <param name="other">The version to compare with this instance.</param>
|
/// <param name="other">The version to compare with this instance.</param>
|
||||||
bool IsNewerThan(ISemanticVersion other);
|
bool IsNewerThan(ISemanticVersion other);
|
||||||
|
|
||||||
|
/// <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>
|
||||||
|
bool IsBetween(ISemanticVersion min, ISemanticVersion max);
|
||||||
|
|
||||||
/// <summary>Get a string representation of the version.</summary>
|
/// <summary>Get a string representation of the version.</summary>
|
||||||
string ToString();
|
string ToString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,6 +134,14 @@ namespace StardewModdingAPI
|
||||||
return this.CompareTo(other) > 0;
|
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>
|
/// <summary>Get a string representation of the version.</summary>
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue