コード例 #1
0
ファイル: GoLogical.cs プロジェクト: liyuanmu/Leelanet
        public void Add(int x, int y, POINTSTATUS color)
        {
            GoPointStatus gp = new GoPointStatus();

            gp.x      = x;
            gp.y      = y;
            gp.Status = color;

            GoPoints.Add(gp);
            SwitchPlayer();
        }
コード例 #2
0
ファイル: GoLogical.cs プロジェクト: liyuanmu/Leelanet
 private void SwitchPlayer()
 {
     CurrentColor = CurrentColor == POINTSTATUS.BLACK ? POINTSTATUS.WHITE : POINTSTATUS.BLACK;
 }
コード例 #3
0
ファイル: GoLogical.cs プロジェクト: liyuanmu/Leelanet
        private bool get_adjacent_intersections(int i, int j, POINTSTATUS type)
        {
            //allTempPoints = allPoints;
            if (i > 0)
            {
                if (allTempPoints[i - 1, j] == type && allTempPoints[i - 1, j] != POINTSTATUS.VISITED)
                {
                    allTempPoints[i - 1, j] = POINTSTATUS.VISITED;
                    if (get_adjacent_intersections(i - 1, j, type))
                    {
                        return(true);
                    }
                }
                else if (allTempPoints[i - 1, j] == POINTSTATUS.EMPTY)
                {
                    return(true);
                }
            }
            if (j < 18)
            {
                if (allTempPoints[i, j + 1] == type && allTempPoints[i, j + 1] != POINTSTATUS.VISITED)
                {
                    allTempPoints[i, j + 1] = POINTSTATUS.VISITED;
                    if (get_adjacent_intersections(i, j + 1, type))
                    {
                        return(true);
                    }
                }
                else if (allTempPoints[i, j + 1] == POINTSTATUS.EMPTY)
                {
                    return(true);
                }
            }
            if (i < 18)
            {
                if (allTempPoints[i + 1, j] == type && allTempPoints[i + 1, j] != POINTSTATUS.VISITED)
                {
                    allTempPoints[i + 1, j] = POINTSTATUS.VISITED;
                    if (get_adjacent_intersections(i + 1, j, type))
                    {
                        return(true);
                    }
                }
                else if (allTempPoints[i + 1, j] == POINTSTATUS.EMPTY)
                {
                    return(true);
                }
            }
            if (j > 0)

            {
                if (allTempPoints[i, j - 1] == type && allTempPoints[i, j - 1] != POINTSTATUS.VISITED)
                {
                    allTempPoints[i, j - 1] = POINTSTATUS.VISITED;
                    if (get_adjacent_intersections(i, j - 1, type))
                    {
                        return(true);
                    }
                }
                else if (allTempPoints[i, j - 1] == POINTSTATUS.EMPTY)
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #4
0
ファイル: GoLogical.cs プロジェクト: liyuanmu/Leelanet
 private bool IsSuiCide(int x, int y, POINTSTATUS type)
 {
     allTempPoints       = (POINTSTATUS[, ])allPoints.Clone();
     allTempPoints[x, y] = POINTSTATUS.VISITED;
     return(!get_adjacent_intersections(x, y, allPoints[x, y]));
 }
コード例 #5
0
ファイル: LeeBoard.cs プロジェクト: liyuanmu/Leelanet
 public void DrawPiece(LeeBitmap leeBitmap, int x, int y, POINTSTATUS pIECECOLOR = POINTSTATUS.BLACK)
 {
     leeBitmap.DrawPiece(startX - pieceSize / 2 + x * interval, startY - pieceSize / 2 + y * interval, pieceSize, pIECECOLOR == POINTSTATUS.BLACK?Color.Black: Color.White);
     //leeBitmap.DrawArc(startX - pieceSize / 2, startY - pieceSize / 2, pieceSize - 2, pieceSize - 2, Color.White);
 }