示例#1
0
        /// <summary>
        /// Creer clients marchandise
        /// </summary>
        /// <param name="listAreoport">Liste d'areoport</param>
        /// <param name="origine">Position d'origine de l'areoport</param>
        /// <param name="rand"></param>
        /// <returns></returns>
        public Client creerMarchandise(List <Aeroport> listAreoport, Aeroport origine, Random rand)
        {
            Client newClient = null;

            newClient = new Marchandise(listAreoport, origine, rand);

            return(newClient);
        }
示例#2
0
        /// <summary>
        /// Creer clients passager
        /// </summary>
        /// <param name="listAreoport">Liste d'areoport</param>
        /// <param name="origine">Position d'origine de l'areoport</param>
        /// <param name="rand"></param>
        /// <returns></returns>
        public Client creerPassager(List <Aeroport> listAreoport, Aeroport origine, Random rand)
        {
            Client newClient = null;

            newClient = new Passager(listAreoport, origine, rand);

            return(newClient);
        }
示例#3
0
        /// <summary>
        /// Vérifie si l'areoport passé possède un avion secours de dispo
        /// </summary>
        /// <param name="areoport">Areoport a verifier</param>
        /// <returns>1 si oui, 0 si non</returns>
        public int possedeAreoSecours(Aeroport areoport)
        {
            int temp = -1;

            for (int i = 0; i < areoport.m_listAeronef.Count; i++)
            {
                if (areoport.m_listAeronef[i].Type == "Secours")
                {
                    if (areoport.m_listAeronef[i].Dispo)
                    {
                        temp = 1;
                    }
                    else
                    {
                        temp = 2;
                    }
                }
            }
            return(temp);
        }
示例#4
0
        /// <summary>
        /// Obtient une aréoport aléatoire dans la liste
        /// </summary>
        /// <param name="listAreoport">Liste d'aréoports</param>
        /// <param name="origine">Origine de l'areoport</param>
        /// <param name="rand"></param>
        /// <returns>Areoport aléatoire</returns>
        public Aeroport randomAreoport(List <Aeroport> listAreoport, Aeroport origine, Random rand)
        {
            int  count       = listAreoport.Count();
            bool different   = false;
            int  destination = -1;

            while (!different)
            {
                destination = rand.Next(count);
                if (listAreoport[destination].Equals(origine))
                {
                    different = true;
                }
                else
                {
                    different = false;
                }
            }

            return(listAreoport[destination]);
        }
示例#5
0
 /// <summary>
 /// Constructeur d'un client marchandise
 /// </summary>
 /// <param name="listAreoport">Liste d'areoports du scénario</param>
 /// <param name="origine">Position d'origine de la marchandise</param>
 /// <param name="rand"></param>
 public Marchandise(List <Aeroport> listAreoport, Aeroport origine, Random rand) : base(listAreoport, rand)
 {
     this.m_nom         = "Marchandise";
     this.m_destination = randomAreoport(listAreoport, origine, rand);
     this.m_poid        = nbPoid(rand);
 }
示例#6
0
 /// <summary>
 /// Constructeur d'un client passager
 /// </summary>
 /// <param name="listAreoport">Liste d'aréoports</param>
 /// <param name="origine">point d'origine du client</param>
 /// <param name="rand"></param>
 public Passager(List <Aeroport> listAreoport, Aeroport origine, Random rand) : base(listAreoport, rand)
 {
     this.m_nom         = "Passager";
     this.m_destination = randomAreoport(listAreoport, origine, rand);
     this.m_quantite    = nbPassager(rand);
 }