Class ComparableExtensions
Inheritance
object
ComparableExtensions
Namespace: TetraCreations.Core
Assembly: cs.temp.dll.dll
Syntax
public static class ComparableExtensions
Methods
InRange<T>(T, T, T, MatchInclusive)
Checks if a value is in between a specific range, by default both lower and upper limit are inclusive.
For example 10.InRange(0,10) will return true but 10.InRange(0,10, MatchInclusive.Lower) will return false.
Declaration
public static bool InRange<T>(this T actual, T lower, T upper, MatchInclusive matchInclusive = MatchInclusive.Both) where T : IComparable<T>
Parameters
| Type | Name | Description |
|---|---|---|
| T | actual | |
| T | lower | |
| T | upper | |
| MatchInclusive | matchInclusive |
Returns
| Type | Description |
|---|---|
| bool |
Type Parameters
| Name | Description |
|---|---|
| T |