def add_move_for_straight_line_pieces(move_matrix, row, col, game_board, piece, moves):
    """
    Adds moves for Rook, Bishop and Queen
    :param move_matrix: How the piece moves
    :param row: Which row the piece is on
    :param col: Which column the piece is on
    :param game_board: game_board array
    :param piece: The piece
    :param moves: Current moves
    :return: Array of legal moves
    """
    for m in move_matrix:
        for i in range(1, 8):
            target_row = row + (i * m[0])
            target_col = col + (i * m[1])
            if 0 <= target_row < 8 and 0 <= target_col < 8:
                target = game_board[target_row, target_col].get_content()
                if target is not None:
                    if (
                            piece.get_type().islower() and target.get_type().isupper()
                    ) or (
                            piece.get_type().isupper() and target.get_type().islower()
                    ):
                        moves.append([i * m[0], i * m[1]])
                    break
                moves.append([i * m[0], i * m[1]])
            else:
                break
    return moves