public Auto() { int num; num = numRandom.Next(1, 3); switch (num) { case 1: this.Fabricante = (EFabricante)1; break; case 2: this.Fabricante = (EFabricante)2; break; case 3: this.Fabricante = (EFabricante)3; break; } this.DI = new Rueda(); this.DD = new Rueda(); this.TI = new Rueda(); this.TD = new Rueda(); Auto.ContadorDeObjetos++; this.TiempoDemorado = 0; this.KilometroRecarrido = 0; }
public Auto() { numero = randomMarca.Next(1, 3); this.fabricante = (EFabricante)numero; this.ruedaDI = new Rueda();//esto se denomina instanciar this.ruedaDD = new Rueda(); this.ruedaTI = new Rueda(); this.ruedaTD = new Rueda(); Auto.contadorDeObjetos++; }
public Auto() { //Random random = new Random(); int numero; numero = randomFabricante.Next(0, 9); this.fabricante = (EFabricante)numero; this.TI = new Rueda(); this.TD = new Rueda(); this.DD = new Rueda(); this.DI = new Rueda(); Auto.contadorObjetos++; this.tiempoTardado = 0; this.kilometrosRecorridos = 0; }
public static List <Tren> Leer() { List <Tren> trenesL = new List <Tren>(); Tren tren; string consulta = String.Format("Select * from trenes"); try { comando.CommandText = consulta; conexion.Open(); SqlDataReader oDr = comando.ExecuteReader(); while (oDr.Read()) { int velocidad = int.Parse(oDr["velocidad"].ToString()); EFabricante fabricante = (EFabricante)oDr["fabricante"]; string cantVagones = oDr["cantidad_vagones"].ToString(); tren = new Tren(velocidad, fabricante, cantVagones); trenesL.Add(tren); } } catch (Exception e) { throw e; } finally { conexion.Close(); } return(trenesL); }
public Tren(int velocidad, EFabricante fabricante, string cantidadVagones) : base(fabricante, velocidad) { this.canVagones = cantidadVagones; this.fabricante = fabricante; this.velocidad = velocidad; }
public Avion(int velocidad, EFabricante fabricante, string aerolinea) : base(fabricante, velocidad) { this.velocidad = velocidad; this.fabricante = fabricante; this.aerolinea = aerolinea; }
public Auto(string nombrePiloto, EFabricante fabricanteAuto) : this() { this._nombrePiloto = nombrePiloto; this._fabricanteAuto = fabricanteAuto; }
protected Transporte(EFabricante fabricante, int velocidad) { this.velocidad = velocidad; this.fabricante = fabricante; }
public Auto(string NombrePiloto, EFabricante Fabricante) { this._nombrePiloto = NombrePiloto; this._Fabricante = (EFabricante)Fabricante; }
public Transporte(EFabricante fabricante, int velocidad) { this.Velocidad = velocidad; this.Fabricante = fabricante; }