コード例 #1
0
ファイル: MathLib.cs プロジェクト: yuguorui/Gomoku
 /// <summary>
 /// Check if the specified range overlaps with the range.
 /// </summary>
 /// 
 /// <param name="range">Range to check for overlapping.</param>
 /// 
 /// <returns><b>True</b> if the specified range overlaps with the range or
 /// <b>false</b> otherwise.</returns>
 /// 
 public bool IsOverlapping(Range range)
 {
     return ((IsInside(range.min)) || (IsInside(range.max)) ||
              (range.IsInside(min)) || (range.IsInside(max)));
 }
コード例 #2
0
ファイル: MathLib.cs プロジェクト: yuguorui/Gomoku
        /// <summary>
        /// Initializes a new instance of the <see cref="UniformGenerator"/> class.
        /// </summary>
        /// 
        /// <param name="range">Random numbers range.</param>
        /// <param name="seed">Seed value to initialize random numbers generator.</param>
        /// 
        public UniformGenerator(Range range, int seed)
        {
            rand = new UniformOneGenerator(seed);

            min = range.Min;
            length = range.Length;
        }
コード例 #3
0
ファイル: MathLib.cs プロジェクト: yuguorui/Gomoku
 /// <summary>
 /// Check if the specified range is inside of the range.
 /// </summary>
 /// 
 /// <param name="range">Range to check.</param>
 /// 
 /// <returns><b>True</b> if the specified range is inside of the range or
 /// <b>false</b> otherwise.</returns>
 /// 
 public bool IsInside(Range range)
 {
     return ((IsInside(range.min)) && (IsInside(range.max)));
 }
コード例 #4
0
ファイル: MathLib.cs プロジェクト: yuguorui/Gomoku
 /// <summary>
 /// Initializes a new instance of the <see cref="UniformGenerator"/> class.
 /// </summary>
 /// 
 /// <param name="range">Random numbers range.</param>
 /// 
 /// <remarks>Initializes random numbers generator with zero seed.</remarks>
 /// 
 public UniformGenerator(Range range) :
     this(range, 0)
 {
 }