예제 #1
0
 /// <summary>
 /// Creates a clone of this instance
 /// </summary>
 /// <returns>Clone of this instance</returns>
 public object Clone()
 {
     return(new Channels
     {
         HTTP = (Channel)HTTP.Clone(),
         Telnet = (Channel)Telnet.Clone(),
         File = (Channel)File.Clone(),
         USB = (Channel)USB.Clone(),
         AUX = (Channel)AUX.Clone(),
         Daemon = (Channel)Daemon.Clone(),
         CodeQueue = (Channel)CodeQueue.Clone(),
         LCD = (Channel)LCD.Clone(),
         SPI = (Channel)SPI.Clone(),
         AutoPause = (Channel)AutoPause.Clone()
     });
 }
예제 #2
0
파일: Mock1.cs 프로젝트: elkawee/UShell
 public static T[]            FindObjectsOfTypeAll <T>()
 {
     if (typeof(T).IsSubclassOf(typeof(Component)))
     {
         return(roots
                .SelectMany(root_obj => AUX.SelfAndAllDescendants(root_obj))
                .Select(obj => obj.GetComponent <T>())
                .Where(obj => obj != null)
                .ToArray());
     }
     else if (typeof(T) == typeof(GameObject))
     {
         return(roots
                .SelectMany(root_obj => AUX.SelfAndAllDescendants(root_obj))
                .Select(obj => (T)(System.Object)obj)
                .ToArray());
     }
     else
     {
         throw new NotImplementedException();
     }
 }
예제 #3
0
        /// <summary>
        /// Assigns every property from another instance
        /// </summary>
        /// <param name="from">Object to assign from</param>
        /// <exception cref="ArgumentNullException">other is null</exception>
        /// <exception cref="ArgumentException">Types do not match</exception>
        public void Assign(object from)
        {
            if (from == null)
            {
                throw new ArgumentNullException();
            }
            if (!(from is Channels other))
            {
                throw new ArgumentException("Invalid type");
            }

            HTTP.Assign(other.HTTP);
            Telnet.Assign(other.Telnet);
            File.Assign(other.File);
            USB.Assign(other.USB);
            AUX.Assign(other.AUX);
            Daemon.Assign(other.Daemon);
            CodeQueue.Assign(other.CodeQueue);
            LCD.Assign(other.LCD);
            SPI.Assign(other.SPI);
            AutoPause.Assign(other.AutoPause);
        }
예제 #4
0
        public void UnionSiguiente(ListaEstados L)
        {
            foreach (string alvTrans in lista_terminal)
            {
                //    Console.WriteLine(alvTrans + "aquiiiiii");
                foreach (NodoThomson alv in L.GetListaCerradura())
                {
                    RecursivoMov(alv, alvTrans);
                }
                foreach (NodoThomson item in lista_mov)
                {
                    RecursivoCerr(item, "epsilon");
                    bool aux = false;

                    foreach (ListaEstados AUX in ESTADOS)
                    {
                        if (repetido3(AUX.GetListaCerradura()) == true)
                        {
                            L.GetListaEstados().AddLast(new ListaEstados(AUX, alvTrans));
                            lista_ceradura = new LinkedList <NodoThomson>();
                            Console.WriteLine("repetido");
                            lista_mov = new LinkedList <NodoThomson>();
                            aux       = true;
                        }
                    }
                    if (aux == false)
                    {
                        bool         aux2 = false;
                        ListaEstados L2   = new ListaEstados(lista_ceradura);
                        foreach (NodoThomson LOOL in lista_ceradura)
                        {
                            foreach (NodoThomson ALVVV in lista_lineal_nodos)
                            {
                                if (ALVVV.sig1 != null)
                                {
                                    if (LOOL.GetEstado().Equals(ALVVV.GetEstado()))
                                    {
                                        Console.WriteLine("SIUUUUUUUUUUUUUUUUUUUUUUUUUUUU" + LOOL.GetEstado());
                                        ALVVV.SetTipo("FIN");
                                    }
                                }

                                else if (ALVVV.sig2 != null)
                                {
                                    if (LOOL.GetEstado().Equals(ALVVV.GetEstado()))
                                    {
                                        ALVVV.SetTipo("FIN");
                                        Console.WriteLine("SIUUUUUUUUUUUUUUUUUUUUUUUUUUUU" + LOOL.GetEstado());
                                    }
                                }
                            }
                        }

                        ESTADOS.AddLast(L2);
                        L.GetListaEstados().AddLast(new ListaEstados(L2, alvTrans));

                        lista_ceradura = new LinkedList <NodoThomson>();
                        Console.WriteLine("nuevoo " + "->");
                        lista_mov = new LinkedList <NodoThomson>();

                        UnionSiguiente(L2);
                    }
                }
            }
        }