예제 #1
0
파일: Range.cs 프로젝트: jackjet870/NStack
 /// <summary>
 ///     Returns whether or not the two ranges intersect.
 /// </summary>
 /// <param name="first">The first range.</param>
 /// <param name="second">The second range.</param>
 /// <returns>True if the ranges intersect; otherwise, false.</returns>
 public static bool Intersects(Range<T> first, Range<T> second)
 {
     return !(second.Maximum.CompareTo(first.Minimum) <= 0 || first.Maximum.CompareTo(second.Minimum) <= 0);
 }
예제 #2
0
파일: Range.cs 프로젝트: jackjet870/NStack
 /// <summary>
 ///     Returns whether or not <paramref name="other" /> intersects the current range.
 /// </summary>
 /// <param name="other">The other range.</param>
 /// <returns>True if the ranges intersect; otherwise, false.</returns>
 public virtual bool Intersects(Range<T> other)
 {
     return Intersects(this, other);
 }