Пример #1
0
        //Creer un lot de cargaison pour un aeroport
        private CClients CreerCargaison(int min, int max, CAeroport SelfAero)
        {
            Random rand     = new Random(DateTime.Now.Millisecond);
            double quantite = rand.Next((min * 10), (max * 10));

            UsineClient usineClient = new UsineClient();

            return(usineClient.creeClient(PrendreAeroportRand(SelfAero), quantite));
        }
Пример #2
0
        //Prend un aeroport random comme destination
        private CAeroport PrendreAeroportRand(CAeroport SelfAero)
        {
            CAeroport Destination;
            Random    rand = new Random(DateTime.Now.Millisecond);
            int       ind  = rand.Next(0, this.ListeAeroports.Count());

            if (this.ListeAeroports[ind] != SelfAero)
            {
                Destination = this.ListeAeroports[ind];
                return(Destination);
            }
            else
            {
                PrendreAeroportRand(SelfAero);
            }
            return(null);
        }
Пример #3
0
        //trouve l'aeroport la plus proche d'une position
        private CAeroport TrouverAeroportProche(Position mapPosition, typeAvion avionType)
        {
            List <CAeroport> cAeroports = ListeAeroports.FindAll(aeroports => aeroports.nbAeronef > 0);
            CAeroport        aeroport   = null;//Aeroport actuellement le plus près

            foreach (CAeroport Aero in cAeroports)
            {
                if (aeroport == null)
                {
                    aeroport = Aero;
                }
                else if (CalculerDistance(aeroport.position, mapPosition) > CalculerDistance(Aero.position, mapPosition))
                {
                    if (Aero.Listaeronefs.Exists(aeronef => aeronef.Type == avionType))
                    {
                        aeroport = Aero;
                    }
                }
            }
            return(aeroport);
        }
Пример #4
0
 public CCargaison(typeClient client, CAeroport aeroport, double poid) : base(client, aeroport)
 {
     m_poid      = poid;
     Destination = aeroport;
 }
Пример #5
0
 public CClients creeClient(CAeroport aeroport, double poid)
 {        // Aeronef cargaison
     return(new CCargaison(typeClient.Cargaison, aeroport, poid));
 }
Пример #6
0
 // DansAeroport
 public CClients creeClient(CAeroport aeroport, int nombreClient)
 {        // Aeronef Voyageur
     return(new CVoyageur(typeClient.Voyageur, aeroport, nombreClient));
 }
Пример #7
0
 public CVoyageur(typeClient client, CAeroport aeroport, int nombreClient) : base(client, aeroport)
 {
     this.nombreClient = nombreClient;
     Destination       = aeroport;
 }
Пример #8
0
 public CDansAeroport(typeClient client, CAeroport Destination) : base(client)
 {
     this.Destination = Destination;
 }
Пример #9
0
 public void AjouterAeronef(CAeroport Aeroport, CAeronef Aeronef)
 {
     Aeroport.AjouterAeronef(Aeronef);
 }
Пример #10
0
        public void AjouterAeroport(string nom, string ville, int posX, int posY, int minPass, int maxPass, int minCargo, int maxCargo)
        {
            CAeroport Aeroport = new CAeroport(nom, ville, minPass, maxPass, minCargo, maxCargo, posX, posY);

            ListeAeroports.Add(Aeroport);
        }