public override Steering getSteering(AgenteNPC agente) { int count = 0; float distance; float orientacion = Cuerpo.positionToAngle(Vector3.zero); float direction = 1; float alpha; foreach (Agente t in targets) { distance = (t.getPosition() - agente.getPosition()).magnitude; if (distance > threshold) { continue; } orientacion += t.getOrientation(); count++; } if (count > 0) { orientacion /= count; orientacion -= agente.getOrientation(); } return(new Steering(orientacion, Vector3.zero)); }
//float orientation; public override Steering getSteering(AgenteNPC agente) { Steering steering = new Steering(0, new Vector3(0, 0, 0)); wanderOrientation += Random.Range(-1, 1) * wanderRate; float targetOrientation; targetOrientation = wanderOrientation + agente.orientation; Vector3 centro; centro = agente.position + wanderOffset * Cuerpo.orientationToVector(agente.orientation); centro += wanderRadius * orientationAsVector(targetOrientation); target = new Agente(centro); steering = base.getSteering(agente); steering.linear = agente.maxAcceleration * Cuerpo.orientationToVector(agente.orientation); return(steering); }
public async Task <IActionResult> Edit(int id, [Bind("IdCuerpo,Rut,DigitoVerificador,Denominacion,NombreFantasia")] Cuerpo cuerpo) { if (id != cuerpo.IdCuerpo) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cuerpo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CuerpoExists(cuerpo.IdCuerpo)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cuerpo)); }
public void Ejecutar() { reiniciarEjecucion(); definirContextoGlobal(); Contexto local = new Contexto(); foreach (ParseTreeNode declaracion in variables) { Declaracion decla = new Declaracion(declaracion); decla.ejecutar(local, Constantes.GLOBAL); } Console.WriteLine("contexto global creado"); if (Principal == null) { ListaErrores.getInstance().nuevoErrorGeneral("El metodo principal no ha sido definido", archivo); return; } Cuerpo _principal = new Cuerpo(Principal.ChildNodes[0], false); _principal.ejecutar(local, Constantes.GLOBAL + 1); Console.WriteLine("Ejecucion Exitosa"); Console.WriteLine("Salida"); Interprete.getContextoGlobal().reporte(); local.reporte(); Console.WriteLine(Interprete.Salida); }
private Showroom guardarSeccionCuerpo(Showroom showroom, int IdCuerpo, bool esNuevoCuerpo, string tipoDeLetraCuerpo) { if (IdCuerpo != 0) { if (showroom.tieneBanner() && !esNuevoCuerpo) { if (showroom.Cuerpo == null) { showroom.Cuerpo = CuerpoDao.get(_context, Convert.ToInt32(showroom.CuerpoID)); } showroom.Cuerpo.llenarParaEdicion(null, null, null, tipoDeLetraCuerpo); } else { showroom.CuerpoID = IdCuerpo; ElementoMenuDAD elemento = _context.ElementosMenuDADs.Single(m => m.ID == IdCuerpo); Cuerpo cuerpo = new Cuerpo { Showroom = showroom, TipoDeLetra = "", Html = elemento.Html, UrlLogo = "" }; showroom.Cuerpo = cuerpo; showroom.CuerpoID = IdCuerpo; } } CuerpoDao.grabarActualizar(_context, showroom.Cuerpo); //ShowroomDao.grabar(_context, showroom); return(showroom); }
private void Cuerpo_KeyUp(object sender, KeyEventArgs e) { int Position = Cuerpo.SelectionStart; int Line = Cuerpo.GetLineFromCharIndex(Position) + 1; int Colunm = Position - Cuerpo.GetFirstCharIndexOfCurrentLine(); Punto.Text = "Fila: " + Line + " Columna: " + Colunm; }
public async Task <IActionResult> Create([Bind("IdCuerpo,Rut,DigitoVerificador,Denominacion,NombreFantasia")] Cuerpo cuerpo) { if (ModelState.IsValid) { _context.Add(cuerpo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(cuerpo)); }
public static void grabarActualizar(HiShopContext context, Cuerpo cuerpo) { if (cuerpo.ID != 0) { context.Cuerpos.Update(cuerpo); } else { context.Cuerpos.Add(cuerpo); } context.SaveChanges(); }
public DataModel OptenerHtmlCuerpo(int idCuerpo) { Cuerpo cuerpo = null; if (idCuerpo != 0) { cuerpo = CuerpoDao.get(_context, idCuerpo); } DataModel respuesta = new DataModel(); respuesta.data.Add("html", cuerpo != null ? cuerpo.Html : ""); return(respuesta); }
/// <summary> /// Trae un cuerpo por id /// Axel Molaro /// </summary> /// <param name="context"></param> /// <param name="id"></param> /// <returns></returns> public static Cuerpo get(HiShopContext context, int id) { Cuerpo cuerpo = null; try { cuerpo = context.Cuerpos.Single(m => m.ID == id); } catch { throw new InvalidDataException("Ocurrio un error al buscar el cuerpo, verifique los datos ."); } return(cuerpo); }
public IActionResult Ver(int id) { ShowroomVerModelAndView model = new ShowroomVerModelAndView(); Negocio negocio = NegocioDao.get(_context, id); Showroom showroom = new Showroom(); Banner banner = new Banner(); Cuerpo cuerpo = new Cuerpo(); model.llenarDatosGenerales(HttpContext, _context); if (negocio.Showroom != null || negocio.ShowroomID != null) { if (negocio.ShowroomID != null) { showroom = ShowroomDao.get(_context, Convert.ToInt32(negocio.ShowroomID)); } else { showroom = negocio.Showroom; } } if (showroom.Banner != null || showroom.BannerID != null) { if (showroom.BannerID != null) { banner = BannerDao.get(_context, Convert.ToInt32(showroom.BannerID)); } else { banner = showroom.Banner; } } if (showroom.Cuerpo != null || showroom.CuerpoID != null) { if (showroom.CuerpoID != null) { cuerpo = CuerpoDao.get(_context, Convert.ToInt32(showroom.CuerpoID)); } else { cuerpo = showroom.Cuerpo; } } model.Showroom = showroom; model.Banner = banner; model.Cuerpo = cuerpo; //model.llenarElmentos(_context, negocio); return(View(model)); }
public override string RenderControl() { string formularioHtml; try { formularioHtml = $@" <!-- ******************* cabecera de los datos del formulario ******************* --> <div id=¨{Cabecera.IdHtml}¨ class=¨cuerpo-cabecera¨ controlador={Controlador} accion={Vista} datos={Cuerpo.IdHtml} pie={Pie.IdHtml}> {Cabecera.RenderCabecera()} </div> <!-- ******************* datos del formulario ******************* --> <div id=¨{Cuerpo.IdHtml}¨ class=¨cuerpo-datos¨ style= ¨grid-template-rows: 0% 0% 100%;¨> <div id = formulario-filtro class=¨{Css.Render(enumCssCuerpo.CuerpoDatosFiltro)}¨ style=¨display: none; height: 0px; width: 0px;¨> </div> <div id = formulario-grid class=¨{Css.Render(enumCssCuerpo.CuerpoDatosGrid)}¨ style=¨display: none; height: 0px; width: 0px;¨> </div> <div id = formulario-cuerpo class=¨{Css.Render(enumCssCuerpo.CuerpoDatosFormulario)}¨> {Cuerpo.RenderCuerpo()} </div> </div> <!-- ******************* pie del formulario ******************* --> <div id=¨{Pie.IdHtml}¨ class=¨{Css.Render(enumCssCuerpo.CuerpoPie)}¨ style= ¨grid-template-columns: 0% 0% 0% 0% 100%;¨> <div id=¨formulario-navegador¨ class=¨{Css.Render(enumCssNavegadorEnMnt.Navegador)}¨ style=¨display: none; height: 0px; width: 0px;¨> </div> <div id=¨formulario-opciones¨ class=¨{Css.Render(enumCssNavegadorEnMnt.Opcion)}¨ style=¨display: none; height: 0px; width: 0px;¨> </div> <div id=¨formulario-mensaje¨ class=¨{Css.Render(enumCssNavegadorEnMnt.Mensaje)}¨ style=¨display: none; height: 0px; width: 0px;¨> </div> <div id=¨formulario-infoGrid¨ class=¨{Css.Render(enumCssNavegadorEnMnt.InfoGrid)}¨ style=¨display: none; height: 0px; width: 0px;¨> </div> <div id=¨{Pie.IdHtml}-formulario¨ class=¨{Css.Render(enumCssCuerpo.CuerpoPieFormulario)}¨> {Pie.RenderPie()} </div> </div> "; } catch (Exception e) { return($@" <input id=error>{e.Message}</input> "); } return(formularioHtml); }
private ParseTreeNode getCuerpo(ParseTreeNode nodoCuerpo) { Cuerpo contenido = new Cuerpo(); Instruccion actual; foreach (ParseTreeNode item in nodoCuerpo.ChildNodes) { actual = getInstruccion(item); if (actual != null) { contenido.addInstruccion(actual); } } return(nodoCuerpo); }
//CrearCorreo //sirve para crear y ensamblar el mensaje private void CrearCorreo() { this.Mensaje.From = new MailAddress(this.Email.ToString(), this.De.ToString()); this.Mensaje.To.Add(this.Para.ToString()); if (this.Cc != "") { this.Mensaje.CC.Add(this.Cc.ToString()); } if (this.Bcc != "") { this.Mensaje.Bcc.Add(this.Bcc.ToString()); } this.Mensaje.Subject = this.Asunto.ToString(); if (this.FormatoHTML == true) { this.Mensaje.IsBodyHtml = true; } this.Mensaje.Body = Cuerpo.ToString(); }
public bool EnivarCorreo() { cFunciones.AppSetting fn = new cFunciones.AppSetting(); MailMessage mail = new MailMessage(); Encoding enc = Encoding.GetEncoding(1253); Encoding StreamEncoding = Encoding.GetEncoding("iso-8859-1"); string Host = fn.ObtenerAppSettings("host"); Int32 Puerto = Convert.ToInt32(fn.ObtenerAppSettings("puerto")); string Sender = fn.ObtenerAppSettings("sender"); string Passwdord = fn.ObtenerAppSettings("password"); bool Ssl = fn.ObtenerAppSettings("ssl") == "S"; try { mail.From = new MailAddress(Remitente); for (Int16 ind = 0; ind < Destinatario.Count; ind++) { mail.To.Add(new MailAddress(Destinatario[ind])); } for (Int16 ind = 0; ind < ConCopia.Count; ind++) { mail.CC.Add(new MailAddress(ConCopia[ind])); } for (Int16 ind = 0; ind < ConCopiaOculta.Count; ind++) { mail.Bcc.Add(new MailAddress(ConCopiaOculta[ind])); } for (Int16 ind = 0; ind < Archivo.Count; ind++) { mail.Attachments.Add(new Attachment(Archivo[ind])); } mail.Subject = Asunto; mail.IsBodyHtml = true; mail.Body = Cuerpo.Replace(Environment.NewLine, "<br />"); mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(Host) { EnableSsl = Ssl, Port = Puerto, UseDefaultCredentials = true, Credentials = new NetworkCredential(Sender, Passwdord) }; smtp.Send(mail); MensajeError = string.Empty; mail.Dispose(); return(true); } catch (SmtpException ex) { mail.Dispose(); MensajeError = ex.Message; return(false); } }
public Cuerpo leerCuerpoPlayer(string cuerpo) { XmlTextReader reader; reader = new XmlTextReader("./Assets/DB/Jugador/CuerposPlayer.xml"); Cuerpo nuevoCuerpo; nuevoCuerpo = new Cuerpo(); while (reader.ReadToFollowing("cuerpo")) { if (reader.GetAttribute(0) == cuerpo) { /* * revisa esto: * ***REVISADO Y ADAPTADO, A MI ME HA MOLADO**** */ nuevoCuerpo.setTipoCuerpo(Tipos.valueOfCuerpos(cuerpo)); reader.ReadToDescendant("nivel"); nuevoCuerpo.setNivel(reader.ReadElementContentAsInt()); reader.ReadToFollowing("mod_vida"); nuevoCuerpo.setModVida(reader.ReadElementContentAsInt()); reader.ReadToFollowing("mod_mana"); nuevoCuerpo.setModMana(reader.ReadElementContentAsInt()); reader.ReadToFollowing("velocidad_movimiento"); nuevoCuerpo.setVelocidadMovimiento(reader.ReadElementContentAsFloat()); /* * CARGAR EL ATAQUE NORMAL */ reader.ReadToFollowing("ataque_normal"); if (reader.GetAttribute(0) == "MELEE") { AtaqueMelee nuevoAtaqueMelee; nuevoAtaqueMelee = new AtaqueMelee(); /* * RECOGE EL ATAQUE RAPIDO */ reader.ReadToDescendant("rapido"); nuevoAtaqueMelee.setArcoRapida(Tipos.valueOfArco(reader.GetAttribute(0))); reader.ReadToDescendant("damage"); nuevoAtaqueMelee.setDmgRapida(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("variacion"); nuevoAtaqueMelee.setVariacionRapida(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("velocidad"); nuevoAtaqueMelee.setVelAtqRapida(reader.ReadElementContentAsFloat()); /* * RECOGE EL ATAQUE LENTO */ reader.ReadToFollowing("lento"); nuevoAtaqueMelee.setArcoLenta(Tipos.valueOfArco(reader.GetAttribute(0))); reader.ReadToDescendant("damage"); nuevoAtaqueMelee.setDmgLenta(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("variacion"); nuevoAtaqueMelee.setVariacionLenta(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("velocidad"); nuevoAtaqueMelee.setVelAtqLenta(reader.ReadElementContentAsFloat()); //asignar el ataque nuevoCuerpo.setAtaqueNormal(nuevoAtaqueMelee); } else { AtaqueRanged nuevoAtaqueRanged; nuevoAtaqueRanged = new AtaqueRanged(); /* * RECOGE ATAQUE RAPIDO */ reader.ReadToDescendant("rapido"); nuevoAtaqueRanged.setTipoProyectil(Tipos.valueOfProyectil(reader.GetAttribute(0))); nuevoAtaqueRanged.setVelTraslProyectil(float.Parse(reader.GetAttribute(1))); reader.ReadToDescendant("damage"); nuevoAtaqueRanged.setDmgRapida(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("variacion"); nuevoAtaqueRanged.setVariacionRapida(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("velocidad"); nuevoAtaqueRanged.setVelAtqRapida(reader.ReadElementContentAsFloat()); /* * RECOGE EL ATAQUE LENTO */ reader.ReadToFollowing("lento"); nuevoAtaqueRanged.setTipoProyectil(Tipos.valueOfProyectil(reader.GetAttribute(0))); nuevoAtaqueRanged.setVelTraslProyectil(float.Parse(reader.GetAttribute(1))); reader.ReadToDescendant("damage"); nuevoAtaqueRanged.setDmgLenta(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("variacion"); nuevoAtaqueRanged.setVariacionLenta(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("velocidad"); nuevoAtaqueRanged.setVelAtqLenta(reader.ReadElementContentAsFloat()); //asigna el ataque nuevoCuerpo.setAtaqueNormal(nuevoAtaqueRanged); } /* * CARGAR EL ATAQUE ESPECIAL */ reader.ReadToFollowing("ataque_especial"); if (reader.GetAttribute(0) == "MELEE") //el ataque especial es MELEE { AtaqueMelee nuevoAtaqueMelee; nuevoAtaqueMelee = new AtaqueMelee(); //establece consumo de mana y cooldown nuevoAtaqueMelee.setConsumoMana(float.Parse(reader.GetAttribute(1))); nuevoAtaqueMelee.setCooldown(float.Parse(reader.GetAttribute(2))); reader.ReadToDescendant("rapido"); nuevoAtaqueMelee.setArcoRapida(Tipos.valueOfArco(reader.GetAttribute(0))); reader.ReadToDescendant("damage"); nuevoAtaqueMelee.setDmgRapida(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("variacion"); nuevoAtaqueMelee.setVariacionRapida(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("velocidad"); nuevoAtaqueMelee.setVelAtqRapida(reader.ReadElementContentAsFloat()); //asignar el ataque nuevoCuerpo.setAtaqueEspecial(nuevoAtaqueMelee); } else { if (reader.GetAttribute(0) == "RANGED") //el ataque especial es RANGED { AtaqueRanged nuevoAtaqueRanged; nuevoAtaqueRanged = new AtaqueRanged(); //establece consumo de mana y cooldown nuevoAtaqueRanged.setConsumoMana(float.Parse(reader.GetAttribute(1))); nuevoAtaqueRanged.setCooldown(float.Parse(reader.GetAttribute(2))); reader.ReadToDescendant("rapido"); nuevoAtaqueRanged.setTipoProyectil(Tipos.valueOfProyectil(reader.GetAttribute(0))); nuevoAtaqueRanged.setVelTraslProyectil(float.Parse(reader.GetAttribute(1))); reader.ReadToDescendant("damage"); nuevoAtaqueRanged.setDmgRapida(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("variacion"); nuevoAtaqueRanged.setVariacionRapida(reader.ReadElementContentAsFloat()); reader.ReadToFollowing("velocidad"); nuevoAtaqueRanged.setVelAtqRapida(reader.ReadElementContentAsFloat()); //asigna el ataque nuevoCuerpo.setAtaqueEspecial(nuevoAtaqueRanged); } else //el ataque especial es BUFFO { AtaqueBuffo nuevoAtaqueBuffo; nuevoAtaqueBuffo = new AtaqueBuffo(); //establece consumo de mana y cooldown nuevoAtaqueBuffo.setConsumoMana(float.Parse(reader.GetAttribute(1))); nuevoAtaqueBuffo.setCooldown(float.Parse(reader.GetAttribute(2))); reader.ReadToDescendant("area"); nuevoAtaqueBuffo.setAreaBuff(Tipos.valueOfArea(reader.ReadElementContentAsString())); reader.ReadToFollowing("buffo"); nuevoAtaqueBuffo.setNombreBuff(int.Parse(reader.GetAttribute(0))); nuevoAtaqueBuffo.setDuracion(int.Parse(reader.GetAttribute(1))); nuevoAtaqueBuffo.setCantidadRaw(reader.ReadElementContentAsFloat()); //asigna el ataque nuevoCuerpo.setAtaqueEspecial(nuevoAtaqueBuffo); } } } } return(nuevoCuerpo); }
} //Cuerpo de la entidad //corpse_ (skin & collider) public Entidad() { corp_ = new Cuerpo(); name_ = ""; pos_ = new Posicion(0, 0); }
public void setTipoEnemigo(Cuerpo tipoEnemigo) { TipoEnemigo = tipoEnemigo; }
public Entidad(int x, int y) { corp_ = new Cuerpo(); name_ = ""; pos_ = new Posicion(x, y); }
//---------------------------------------------------NUEVO-------------------------------------------------------------- private void button2_Click(object sender, EventArgs e) { Cuerpo.ResetText(); ruta = ""; }
public void setCurrentCuerpo(Cuerpo currentCuerpo) { CurrentCuerpo = currentCuerpo; }