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(); }
private void SwitchPlayer() { CurrentColor = CurrentColor == POINTSTATUS.BLACK ? POINTSTATUS.WHITE : POINTSTATUS.BLACK; }
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); }
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])); }
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); }