private Board BuildBoardFromTable(Table table) { var builder = new AsciiBoardBuilder(); var indeces = Enumerable.Range(0, 8).ToList(); indeces.ForEach(ri => indeces.ForEach(ci => AddNonEmptyPiece(builder, table, ri, ci))); var builderGenerateBoard = builder.GenerateBoard(); return(builderGenerateBoard); }
private void AddNonEmptyPiece(AsciiBoardBuilder builder, Table table, int rowIndex, int columnIndex) { var xCoordinate = columnIndex + 1; var yCoordinate = 8 - rowIndex; var pieceString = table.Rows[rowIndex][columnIndex]; if (!string.IsNullOrEmpty(pieceString)) { builder.AddPiece(BoardCoordinate.For(xCoordinate, yCoordinate), pieceString); } }
public void BeforeEachTest() { Target = new AsciiBoardBuilder(); }
public void BeforeEachTest() { Target = new AsciiBoardBuilder(); }