private bool IsAllSquaresAlongCastleAreEmpty(int column1, int column2, Board.Board board) { for (int column = column1; column <= column2; ++column) { if (!board.IsEmpty(initialKingRow, column)) { return(false); } } return(true); }
private void AppendIfCanCapture( BoardSquare destSquare, MoveBuilder moveBuilder, Board.Board board, List <Move> moves, Action <MoveBuilder, List <Move> > moveAppender) { if (board.IsEmpty(destSquare)) { return; } var pieceAtDestSquare = board.GetPieceAt(destSquare); if (pieceAtDestSquare.player != player) { moveAppender( moveBuilder.SetDestSquare(destSquare).SetCapture(pieceAtDestSquare.piece), moves); } }