/// <summary> /// This method need to read the /// </summary> /// <param name="str"></param> public void LoadBoards(StringBuilder str) { string[] listLines = str.ToString().Split('\n'); int intTableNum = listLines.Length / 8; //se barre la cantidad de tableros for (int itable = 0; itable < intTableNum; itable++) { //cada tablero tiene 8 filas y ocho columnas ChessBoard tempChessBoard = new ChessBoard(); for (int i = 0; i < 8; i++) { string strLinea = listLines[itable * 8 + i]; for (int j = 0; j < 8; j++) { char tempFicha = (strLinea.Length > 8) ?strLinea[j]:'.'; BasePiece pieceBase = this.CreatePiace(tempFicha, i, j); tempChessBoard.addPiece(pieceBase); } } ListChessBoards.Add(tempChessBoard); } }
public void ClearBoards() { ListChessBoards.Clear(); }