Beispiel #1
0
        /// <summary>
        /// 判断某一方向是否为活N
        /// </summary>
        /// <param name="direct"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static int checkDirectOnChessForActive(Point point, Direction direct, ChessType type)
        {
            //缓存当前坐标的引用
            ChessPoint tempPoint = Chess.Find(Chess.Find(point).DirectionPoint(direct));
            //循环计数
            int count = 0;

            //寻找
            while (true)
            {
                if (tempPoint != null && tempPoint.Type == type)
                {
                    count++;
                    tempPoint = Chess.Find(tempPoint.DirectionPoint(direct));
                }
                else
                {
                    if (tempPoint != null && tempPoint.Type == ChessType.NULL)
                    {
                        return(count);
                    }
                    else
                    {
                        return(-125);
                    }
                }
            }
        }
Beispiel #2
0
        public static ChessPoint CreateChessPoint(Point point, ChessType type)
        {
            ChessPoint pointInstance = new ChessPoint();

            pointInstance.Point = point;
            pointInstance.Type  = type;

            return(pointInstance);
        }
Beispiel #3
0
 public HistoryRecord(ChessPoint point)
 {
     this.text  = point.Type + "\t\tX:" + point.Point.X + "\tY:" + point.Point.Y;
     this.point = point;
 }