Exemplo n.º 1
0
 //Constructor copia
 public FlightPlan(FlightPlan fp)
 {
     this.ID          = fp.GetID();
     this.compañia    = fp.GetCompañia();
     this.velocidad   = fp.GetVelocidad();
     this.IX          = fp.GetIX();
     this.FX          = fp.GetFX();
     this.AX          = fp.GetAX();
     this.IY          = fp.GetIY();
     this.FY          = fp.GetFY();
     this.AY          = fp.GetAY();
     this.incrementov = fp.GetIncrementoV();
 }
        public void GuardarVuelos(string fichero)       //escribe fichero con los datos actuales de los vuelos
        {
            StreamWriter W = new StreamWriter(fichero); //escribir fichero
            int          i = 0;

            while (i < ListFP.Count)
            {
                FlightPlan f = ListFP[i];
                W.WriteLine(f.GetID() + " " + f.GetCompañia() + " " + Convert.ToString(f.GetVelocidad()) + " " + Convert.ToString(f.GetIX()) + " " + Convert.ToString(f.GetIY()) + " " + Convert.ToString(f.GetAX()) + " " + Convert.ToString(f.GetAY()) + " " + Convert.ToString(f.GetFX()) + " " + Convert.ToString(f.GetFY()));
                i++;
            }
            W.Close(); //cerrar fichero
        }