Exemple #1
0
    IEnumerator GeneraSandwich()
    {
        interfaz [9].gameObject.SetActive(true);
        espereMensaje.text = "Espere...";
        for (int i = 0; i <= ingredientesAleatorios.Count - 1; i++)
        {
            switch (ingredientesAleatorios [i])
            {
            case ActivaPanelDedos.Indice:
                SpawnPanAleatorio();
                break;

            case ActivaPanelDedos.Medio:
                SpawnJamonAleatorio();
                break;

            case ActivaPanelDedos.Anular:
                SpawnQuesoAleatorio();
                break;

            case ActivaPanelDedos.Meñique:
                SpawnJitomateAleatorio();
                break;
            }
            yield return(new WaitForSeconds(_tiempoDePausaEntreIngredientes));
        }
        yield return(new WaitForSeconds(2.0f));

        espereMensaje.text = "¡Ahora!";
        yield return(new WaitForSeconds(1.0f));

        interfaz[9].gameObject.SetActive(false);
        ActivaTecla       = Teclado.PresionaCualquiera;
        _iniciaCronometro = true;
    }
Exemple #2
0
//	IEnumerator AnimacionSalto(){
//		yield return new WaitForSeconds (3.0f);
//		Vector3 temp;
//		for ( int i = 0; i <= _ingredientesAleatorios.Count - 1; i++) {
//			temp = _posicionDeIngredientesClon [i].transform.position;
//			temp.y += (0.12f)*i;
//			_posicionDeIngredientesClon [i].transform.position = temp;
//			_posicionDeIngredientesClon [i].GetComponent <Rigidbody2D> ().bodyType = RigidbodyType2D.Kinematic;
//		}
//
//		yield return new WaitForSeconds (3.0f);
//		for ( int i = 0; i <= _ingredientesAleatorios.Count - 1; i++) {
//			_posicionDeIngredientesClon [i].GetComponent <Rigidbody2D> ().bodyType = RigidbodyType2D.Dynamic;
//		}
//		StartCoroutine (AnimacionSalto ());
//	}

    void Reinicio()
    {
        AdminMenu.datosNivel3.tiempos.Add(_tiempoTemp);
        if (_limite == _numeroDeRepeticiones)
        {
            ActivaTecla   = Teclado.SinPresionar;
            PanelActivado = ActivaPanelInteractivo.Exito;
            ActivaPanel();
            return;
        }

        if (_limite < _numeroDeRepeticiones)
        {
            _iniciaCronometro = true;
            _ingredientesDeUsuario.Clear();
            _errores = 0;
            _contadorIngredientesDeUsuario = 0;
            _tiempoTemp = 0;
            _destruir   = GameObject.FindGameObjectsWithTag("Estatico");
            for (int i = 0; i <= _destruir.Length - 1; i++)
            {
                Destroy(_destruir [i]);
            }
        }
    }
Exemple #3
0
 void Awake()
 {
     _mano = AdminMenu.datosNivel3.ManoSeleccionada;
     _numeroDeIngredientes = AdminMenu.datosNivel3.numeroDeIngredientes;
     _numeroDeRepeticiones = AdminMenu.datosNivel3.numeroDeRepeticiones;
     ayudaBoton.gameObject.SetActive(false);
     interfaz [0].gameObject.SetActive(true);
     _ingredientesDeUsuario      = new List <ActivaPanelDedos> ();
     ingredientesAleatorios      = new List <ActivaPanelDedos> ();
     _posicionDeIngredientesClon = new List <Transform> ();
     _guardaErrores = new List <ActivaPanelDedos> [_numeroDeRepeticiones];
     for (int i = 0; i <= _numeroDeRepeticiones - 1; i++)
     {
         _guardaErrores[i] = new List <ActivaPanelDedos>();
     }
     _iniciaCronometro = false;
     guardaResultados  = new List <List <ActivaPanelDedos> > ();
     ActivaTecla       = Teclado.SinPresionar;
     PanelActivado     = ActivaPanelInteractivo.SinPanel;
     _tiempoDePausaEntreIngredientes = 0.5f;
     _contadorCapa = 1;
     _errores      = 0;
     _contadorIngredientesDeUsuario = 0;
     _limite = 0;
 }
        public IHttpActionResult PutTeclado(int id, Teclado teclado)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != teclado.idTeclado)
            {
                return(BadRequest());
            }

            db.Entry(teclado).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TecladoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
 // Start is called before the first frame update
 void Awake()
 {
     letrasActual  = new List <GameObject>();
     canvas        = GameObject.Find("Canvas");
     tec           = GetComponent <Teclado>();
     letrasParaInt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray();
 }
Exemple #6
0
        /// <summary>
        /// Muestra la informacion del Row seleccionado del DataTable, a traves de un metodo de extension.
        /// Este metodo de extension, agregara la informacion de la garantia del producto.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMostrarInfoDetallada_Click(object sender, EventArgs e)
        {
            try
            {
                int indice = this.dgvGrilla.SelectedRows[0].Index;

                DataRow fila = this.dt.Rows[indice];

                string tipo   = fila["Tipo"].ToString();
                Marca  marca  = MapeoTipoMarca(fila["Marca"].ToString());
                float  precio = float.Parse(fila["Precio"].ToString());
                string nombre = fila["Nombre"].ToString();

                switch (tipo)
                {
                case "Teclado":
                    Teclado t = new Teclado(marca, precio, nombre);
                    MessageBox.Show(t.ObtenerInfoExtendida());
                    break;

                case "Mouse":
                    Mouse m = new Mouse(marca, precio, nombre);
                    MessageBox.Show(m.ObtenerInfoExtendida());
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 void Start()
 {
     sound = GetComponent <AudioSource>();
     anim  = GetComponent <Animator>();
     but   = GetComponent <Button>();
     tec   = GameObject.Find("Teclado").GetComponent <Teclado>();
     GetComponent <Image>().color = new Color(Random.Range(0, 255), Random.Range(0, 255), Random.Range(0, 255), 255);
 }
Exemple #8
0
        public void TestArchivosTexto()
        {
            Teclado teclado = new Teclado(Periferico.Marca.Gigabyte, 123, "Prueba Teclado");

            Texto txtaux = new Texto();

            txtaux.Guardar(@"ABC:\DirectorioErroneo.abc", teclado.ToString());
        }
Exemple #9
0
        public ActionResult DeleteConfirmed(int id)
        {
            Teclado teclado = db.Tecladoes.Find(id);

            db.Tecladoes.Remove(teclado);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #10
0
 private void BtnTecladoConfirmar_Click(object sender, EventArgs e)
 {
     Teclado.keybd_event(Teclado.VK_RETURN, 0, 0, 0);
     Teclado.keybd_event(Teclado.VK_RETURN, 0, Teclado.KEYEVENTF_KEYUP, 0);
     VerificarFoco();
     panel1.Visible = false;
     ApareceBotao();
 }
        public ActionResult DeleteConfirmed(int id)
        {
            Teclado teclado = _UnityOfWork.Teclados.Get(id);

            _UnityOfWork.Teclados.Remove(teclado);
            _UnityOfWork.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public static void Draw(Teclado teclado, Viewport3D viewport3D, Dimensiones dimTeclaBlanca, Dimensiones dimTeclaNegra)
 {
     Dictionary<string, Tecla> teclas = teclado.Teclas;
     int numTeclas = teclas.Count;
     double separacionTeclas = 0.02;
     double offsetX = -calcularAnchoTeclado(teclado, dimTeclaBlanca.Ancho, separacionTeclas)/2;
     //Dimensiones auxiliares con margen
     Dimensiones dimTeclaNegraConMargen = new Dimensiones();
     dimTeclaNegraConMargen.Ancho = dimTeclaNegra.Ancho + separacionTeclas * 2;
     dimTeclaNegraConMargen.Profundidad = dimTeclaNegra.Profundidad + separacionTeclas;
     dimTeclaNegraConMargen.Alto = dimTeclaNegra.Alto;
     for (int i = 0, iTeclaBlanca = 0; i < numTeclas; i++)
     {
         Tecla tecla = teclas.ElementAt(i).Value;
         Tecla teclaAnterior = (i == 0) ? null : teclas.ElementAt(i - 1).Value;
         Tecla teclaSiguiente = (i == numTeclas - 1) ? null : teclas.ElementAt(i + 1).Value;
         double posicionX = offsetX + iTeclaBlanca * dimTeclaBlanca.Ancho;
         posicionX += iTeclaBlanca * separacionTeclas;
         ModelVisual3D model = null;
         // tecla blanca
         if (typeof(TeclaBlanca3D) == tecla.GetType())
         {
             if (isTeclaBlanca(teclaAnterior))
             {
                 if (isTeclaBlanca(teclaSiguiente))
                 {
                     //blanca con anterior blanca y siguiente blanca
                     model = DrawTeclaBlancaTipoA(tecla, dimTeclaBlanca, posicionX, BrushesTeclas.Blanco);
                 }
                 else
                 {
                     //blanca con anterior blanca y siguiente negra;
                     model = DrawTeclaBlancaTipoB(tecla, dimTeclaBlanca, dimTeclaNegraConMargen, posicionX, BrushesTeclas.Blanco);
                 }
             }
             else
             {
                 if (isTeclaBlanca(teclaSiguiente))
                 {
                     //blanca con anterior negra y siguiente blanca
                     model = DrawTeclaBlancaTipoC(tecla, dimTeclaBlanca, dimTeclaNegraConMargen, posicionX, BrushesTeclas.Blanco);
                 }
                 else
                 {
                     //blanca con anterior negra y siguiente negra;
                     model = DrawTeclaBlancaTipoD(tecla, dimTeclaBlanca, dimTeclaNegraConMargen, posicionX, BrushesTeclas.Blanco);
                 }
             }
             iTeclaBlanca++;
         }
         else //tecla negra
         {
             posicionX += separacionTeclas;
             model = DrawTeclaNegra(tecla, dimTeclaNegra, posicionX, BrushesTeclas.Negro);
         }
         viewport3D.Children.Add(model);
     }
 }
Exemple #13
0
    private const int CANCELO = 6;                   //constante que corresponde a la opcion de menu para cancelar

    //constructor
    public Retiro(int numeroCuentaUsuario, Pantalla pantallaATM,
                  BaseDatosBanco baseDatosBancoATM, Teclado tecladoATM,
                  DispensadorEfectivo dispensadorEfectivoATM) : base(numeroCuentaUsuario,
                                                                     pantallaATM, baseDatosBancoATM)
    {
        //inicializa las referencias a teclado y al dispensador de efectivo
        teclado             = tecladoATM;
        dispensadorEfectivo = dispensadorEfectivoATM;
    }
Exemple #14
0
    private const int CANCELO = 0;         //constante que representa la opcion cancelar

    //constructor
    public Deposito(int numeroCuentaUsuario, Pantalla pantallaATM,
                    BaseDatosBanco baseDatosBancoATM, Teclado tecladoATM,
                    RanuraDeposito ranuraDepositoATM) : base(numeroCuentaUsuario,
                                                             pantallaATM, baseDatosBancoATM)
    {
        //inicializa las referencias al teclado y a la ranura depostio
        teclado        = tecladoATM;
        ranuraDeposito = ranuraDepositoATM;
    }
Exemple #15
0
        public void DeleteKeyboard()
        {
            //Primero inserta el teclado en la Base de Datos y despues lo elimina

            Teclado        teclado        = new Teclado("Teclado12", 350, 12, "13", "Genius", "Estandar");
            TecladoNegocio tecladoNegocio = new TecladoNegocio();

            tecladoNegocio.InsertarTeclado(teclado);
            tecladoNegocio.EliminarTeclado(teclado);
        }
Exemple #16
0
 //constructor
 public ATM()
 {
     usuarioAutenticado  = false;                     //al principio el usuario no esta autenticado
     numeroCuentaActual  = 0;                         //al principio no hay numero de cuenta actual
     pantalla            = new Pantalla();            //crea la pantalla
     teclado             = new Teclado();             //crea el teclado
     dispensadorEfectivo = new DispensadorEfectivo(); //crea el dispensador de efectivo
     ranuraDeposito      = new RanuraDeposito();      //crea la ranura de deposito
     baseDatosBanco      = new BaseDatosBanco();      //crea la base de datos de info de cuentas
 }
        public IHttpActionResult GetTeclado(int id)
        {
            Teclado teclado = _UnityOfWork.Teclados.Get(id);

            if (teclado == null)
            {
                return(NotFound());
            }

            return(Ok(teclado));
        }
Exemple #18
0
 public ActionResult Edit([Bind(Include = "idTeclado,Marca,idATM")] Teclado teclado)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teclado).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idATM = new SelectList(db.ATM, "idATM", "Direccion", teclado.idATM);
     return(View(teclado));
 }
        private void btnCargarRich_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < dataGridViewProductos.Rows.Count; i++)
            {
                if (Convert.ToBoolean(dataGridViewProductos.Rows[i].Cells[0].Value) == true)
                {
                    if (TipoProducto == "Celulares")
                    {
                        Celular cel = new Celular(dataGridViewProductos.Rows[i].Cells["Nombre"].Value.ToString(), Convert.ToInt32(dataGridViewProductos.Rows[i].Cells["Precio"].Value.ToString()), Convert.ToInt32(dataGridViewProductos.Rows[i].Cells["Cantidad"].Value) - 1, dataGridViewProductos.Rows[i].Cells["IdProducto"].Value.ToString(), dataGridViewProductos.Rows[i].Cells["Marca"].Value.ToString(), dataGridViewProductos.Rows[i].Cells["Pantalla"].Value.ToString(), dataGridViewProductos.Rows[i].Cells["MIcroprocesador"].Value.ToString());

                        if (Negocio.ListaCelulares[i].Cantidad != 0)
                        {
                            Negocio.ListaCelulares.Add(cel);
                            Negocio.ListaCelulares[i].Cantidad = Negocio.ListaCelulares[i].Cantidad - 1;

                            Venta venta = new Venta(cel.Nombre, cel.Precio, 1, cel.IdProducto, ventaNegocio.NewIdVentas(), cel.Marca, "", cel.Pantalla, cel.Microprocesador);
                            listPreviaVenta.Add(venta);

                            GetProductoEspecifico("Celulares");

                            richTextBoxVentas.Text += venta.Nombre + " " + venta.Precio + " " + venta.Cantidad + " " + venta.IdProducto + " " + venta.Marca + " " + venta.Pantalla + " " + venta.Microprocesador + " " + System.Environment.NewLine;
                        }

                        else
                        {
                            MessageBox.Show("No hay stock del producto " + cel.Nombre);
                        }
                    }

                    else
                    {
                        Teclado teclado = new Teclado(dataGridViewProductos.Rows[i].Cells["Nombre"].Value.ToString(), float.Parse(dataGridViewProductos.Rows[i].Cells["Precio"].Value.ToString()), 1, dataGridViewProductos.Rows[i].Cells["IdProducto"].Value.ToString(), dataGridViewProductos.Rows[i].Cells["Marca"].Value.ToString(), dataGridViewProductos.Rows[i].Cells["Tipo"].Value.ToString());

                        if (Negocio.ListaTeclados[i].Cantidad != 0)
                        {
                            Negocio.ListaTeclados.Add(teclado);
                            Negocio.ListaTeclados[i].Cantidad = Negocio.ListaTeclados[i].Cantidad - 1;

                            Venta venta = new Venta(teclado.Nombre, teclado.Precio, 1, teclado.IdProducto, ventaNegocio.NewIdVentas(), teclado.Marca, teclado.Tipo);
                            listPreviaVenta.Add(venta);

                            GetProductoEspecifico("Teclados");

                            richTextBoxVentas.Text += venta.Nombre + " " + venta.Precio + " " + venta.Cantidad + " " + venta.IdProducto + " " + venta.Marca + " " + venta.Tipo + System.Environment.NewLine;
                        }

                        else
                        {
                            MessageBox.Show("No hay stock del producto " + teclado.Nombre);
                        }
                    }
                }
            }
        }
        public IHttpActionResult GetTeclado(int id)
        {
            Teclado teclado = db.Teclado.Find(id);

            if (teclado == null)
            {
                return(NotFound());
            }

            return(Ok(teclado));
        }
 public ActionResult Edit([Bind(Include = "TecladoId,Marca")] Teclado teclado)
 {
     if (ModelState.IsValid)
     {
         _UnityOfWork.StateModified(teclado);
         _UnityOfWork.SaveChanges();
         return(RedirectToAction("Index"));
     }
     //ViewBag.TecladoId = new SelectList(_UnityOfWork.ATMs.GetEntity(), "AtmId", "Mensaje", teclado.TecladoId);
     ViewBag.TecladoId = new SelectList(_UnityOfWork.Retiros.GetEntity(), "RetiroId", "Monto", teclado.TecladoId);
     return(View(teclado));
 }
Exemple #22
0
        public ActionResult Create([Bind(Include = "idTeclado,Marca,idATM")] Teclado teclado)
        {
            if (ModelState.IsValid)
            {
                db.Teclado.Add(teclado);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.idATM = new SelectList(db.ATM, "idATM", "Direccion", teclado.idATM);
            return(View(teclado));
        }
        public IHttpActionResult PostTeclado(Teclado teclado)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _UnityOfWork.Teclados.Add(teclado);
            _UnityOfWork.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = teclado.TecladoId }, teclado));
        }
        public IHttpActionResult PostTeclado(Teclado teclado)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Teclado.Add(teclado);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = teclado.idTeclado }, teclado));
        }
 private static double calcularAnchoTeclado(Teclado teclado, double anchoTeclaBlanca, double separacionTeclas)
 {
     int numTeclasBlancas = 0;
     foreach (KeyValuePair<string, Tecla> pair in teclado.Teclas)
     {
         if (typeof(TeclaBlanca3D) == pair.Value.GetType())
         {
             numTeclasBlancas++;
         }
     }
     return numTeclasBlancas * (anchoTeclaBlanca + separacionTeclas);
 }
        /// <summary>
        /// Crea el teclado con todos los parametros requeridos.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void btnAceptar_Click(object sender, EventArgs e)
        {
            this.teclado = new Teclado((EColor)base.cmbColor.SelectedItem, (EMarca)base.cmbMarca.SelectedItem, base.chbInalambrico.Checked,
                                       (ETipoTeclado)this.cmbTeclas.SelectedItem);

            //Si no se dejo el TextBox de número de serie vacio se asigna el valor.
            if (base.txbNroSerie.Text != "")
            {
                this.teclado.NroSerie = base.txbNroSerie.Text;
            }

            base.btnAceptar_Click(sender, e);
        }
        // GET: Teclados/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Teclado teclado = _UnityOfWork.Teclados.Get(id);

            if (teclado == null)
            {
                return(HttpNotFound());
            }
            return(View(teclado));
        }
        public IHttpActionResult DeleteTeclado(int id)
        {
            Teclado teclado = db.Teclado.Find(id);

            if (teclado == null)
            {
                return(NotFound());
            }

            db.Teclado.Remove(teclado);
            db.SaveChanges();

            return(Ok(teclado));
        }
        public IHttpActionResult DeleteTeclado(int id)
        {
            Teclado teclado = _UnityOfWork.Teclados.Get(id);

            if (teclado == null)
            {
                return(NotFound());
            }

            _UnityOfWork.Teclados.Remove(teclado);
            _UnityOfWork.SaveChanges();

            return(Ok(teclado));
        }
        public void FabricarPeriferico_Ok()
        {
            //Arrage
            Fabrica f1 = new Fabrica("KV");

            Auricular a1 = new Auricular(EColor.Rosa, EMarca.Redragon, false, true);
            Teclado   t1 = new Teclado(EColor.Verde, EMarca.Razer, true, ETipoTeclado.Mecanico);

            //Act
            bool rta = f1 + a1 && f1 + t1; //Se agregan los perifericos

            //Assert
            Assert.IsTrue(rta);
        }
Exemple #31
0
        // GET: Teclados/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Teclado teclado = db.Tecladoes.Find(id);

            if (teclado == null)
            {
                return(HttpNotFound());
            }
            return(View(teclado));
        }
Exemple #32
0
 public ActionResult Edit([Bind(Include = "TecladoID,FuncionarioID,FabricanteID,ModTecladoID,PlaquetaID")] Teclado teclado)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teclado).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FabricanteID  = new SelectList(db.Fabricantes, "IdFabricante", "Nome", teclado.FabricanteID);
     ViewBag.FuncionarioID = new SelectList(db.Funcionarios, "FuncionarioID", "Nome", teclado.FuncionarioID);
     ViewBag.ModTecladoID  = new SelectList(db.ModTecladoes, "ModTecladoID", "Modelo", teclado.ModTecladoID);
     ViewBag.PlaquetaID    = new SelectList(db.Plaquetas, "PlaquetaID", "PlaquetaID", teclado.PlaquetaID);
     return(View(teclado));
 }
 // Use this for initialization
 void Start()
 {
     estado = new Teclado ();
     titulo = GameObject.Find ("titulo");
     tituloScript = titulo.GetComponent<Titulo> ();
 }
 public void atualizar(IObservavel obj)
 {
     this.estado = obj.getEstado ();
 }
 // Use this for initialization
 void Start()
 {
     this.estado = new Teclado ();
     //this.listaObservadores = new List<IObservador> ();
 }