コード例 #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);
 }