Esempio n. 1
0
 public void SavePassengerData(string firstName, string secondName, int yearOfBirth)
 {
     if (PassengerData.VerifyInputBirthday(yearOfBirth))
     {
         new PassengerData(firstName, secondName, yearOfBirth);
     }
 }
Esempio n. 2
0
    public Family(string surname, float[] chances, TravelClass travelClass)
    {
        Surname = surname;
        string        firstName = Data.RandomElement(Data.FirstNames());
        PassengerData passenger = new PassengerData(firstName, surname, travelClass);

        blueprints.Add(passenger);

        List <Relation> possibleRelations = new List <Relation>();

        for (int i = 0; i < (int)Relation.LAST_ELEMENT; i++)
        {
            possibleRelations.Add((Relation)i);
        }

        Relate(passenger, possibleRelations);

        foreach (float chance in chances)
        {
            if (Random.value < chance)
            {
                firstName = Data.RandomElement(Data.FirstNames());
                passenger = new PassengerData(firstName, surname, travelClass);
                blueprints.Add(passenger);
                Relate(passenger, possibleRelations);
            }
        }
    }
Esempio n. 3
0
 public void Set(PassengerData data)
 {
     firstName   = data.firstName;
     surname     = data.surname;
     gender      = data.gender;
     travelClass = data.travelClass;
 }
Esempio n. 4
0
        public static Domain.Passenger.Passenger Create(PassengerView view)
        {
            var d = new PassengerData();

            Copy.Members(view, d);

            return(new Domain.Passenger.Passenger(d));
        }
Esempio n. 5
0
    public Passenger Instantiate(HousingCar car, PassengerData passengerData)
    {
        Passenger passenger = Instantiate(passengerData);
        Vector3   position  = passengerPrefab.transform.position;

        position.x = car.transform.position.x;
        passenger.transform.position = position;
        return(passenger);
    }
Esempio n. 6
0
    public Passenger Instantiate(PassengerData passengerData)
    {
        GameObject passengerObject = Instantiate(passengerPrefab, passengerParent);
        Passenger  passenger       = passengerObject.GetComponent <Passenger>();

        passenger.Set(passengerData);
        passengers.Add(passenger);
        return(passenger);
    }
Esempio n. 7
0
 void initializeCounterList()
 {
     for (int i = 0; i < passenger_types.Capacity; i++)
     {
         PassengerData p_data = passenger_types[i];
         PassengerType p_type = p_data.type;
         types_counter.Add(p_type, 0);
     }
 }
 public MyTicketsPage FillAllValuesInLabelsWithoutFirstName(PassengerData passengerData)
 {
     passengerLastNameInput.SendKeys(passengerData.LastName);
     passengerGenderInput.Click();
     passengerBirthDayInput.SendKeys(passengerData.BirthDay);
     passengerBirthMonthInput.SendKeys(passengerData.BirthMonth);
     passengerBirthYearInput.SendKeys(passengerData.BirthYear);
     passengerDocNUmInput.SendKeys(passengerData.DocNum);
     passengerDocExpireDateDayInput.SendKeys(passengerData.DocDay);
     passengerDocExpireDateYearInput.SendKeys(passengerData.DocYear);
     passengerBirthMonthInput.SendKeys(passengerData.DocMonth);
     addPassengerButton.Click();
     return(this);
 }
Esempio n. 9
0
    private void Relate(PassengerData passenger, List <Relation> remainingRelations)
    {
        Relation relation = (Relation)Random.Range(0, remainingRelations.Count);

        relations.Add(passenger, relation);
        if (
            relation == Relation.P ||
            relation == Relation.P_SPOUSE ||
            relation == Relation.F0 ||
            relation == Relation.F0_SPOUSE
            )
        {
            remainingRelations.Remove(relation);
        }
    }
 public MyTicketsPage FillAllValuesInLabels(PassengerData passengerData)
 {
     new WebDriverWait(driver, TimeSpan.FromSeconds(10))
     .Until(ExpectedConditions.ElementToBeClickable(addNewPassengerButton));
     addNewPassengerButton.Click();
     passengerLastNameInput.SendKeys(passengerData.LastName);
     passengerFirstNameInput.SendKeys(passengerData.FirstName);
     passengerBirthDayInput.SendKeys(passengerData.BirthDay);
     passengerBirthMonthInput.SendKeys(passengerData.BirthMonth);
     passengerBirthYearInput.SendKeys(passengerData.BirthYear);
     passengerDocNUmInput.SendKeys(passengerData.DocNum);
     passengerDocExpireDateDayInput.SendKeys(passengerData.DocDay);
     passengerDocExpireDateYearInput.SendKeys(passengerData.DocYear);
     passengerBirthMonthInput.SendKeys(passengerData.DocMonth);
     addPassengerButton.Click();
     return(this);
 }
Esempio n. 11
0
        public List <PassengerData> CreatePassengers(string passengerList)
        {
            if (string.IsNullOrEmpty(passengerList))
            {
                return(null);
            }
            //split the input using newline character.
            string[] data = passengerList.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

            //ignore all the entries begin with data .R / and blanks
            //then replace - with / and .L/ with / and .L with empty string
            data = data.Where(s => !s.Contains(".R/") && s != "")
                   .Select(s => { return(s.Replace("-", "|").Replace(".L/", "|.L/ ").Replace(".L /", "|.L/ ")); }).ToArray();

            List <PassengerData> lstPassenger = new List <PassengerData>();

            //loop the strign array to extract passenger details
            for (int i = 0; i < data.Length; i++)
            {
                var temp = data[i].Split('|');

                if (temp != null)
                {
                    var passenger = new PassengerData();
                    for (int j = 0; j < temp.Length; j++)
                    {
                        //name
                        if (temp[j].StartsWith("1"))
                        {
                            passenger.Name = temp[j].Replace("1", string.Empty).Replace("/", " ");
                        }
                        //booking id
                        if (temp[j].StartsWith(".L/"))
                        {
                            passenger.BookingId = temp[j].Replace(".L/ ", "");
                        }
                    }
                    if (passenger.Name != null)
                    {
                        lstPassenger.Add(passenger);
                    }
                }
            }
            return(lstPassenger);
        }
Esempio n. 12
0
        public static List <PassengerProcessedData> ProcessPassengersData(List <Passenger> passengers, Route route)
        {
            var passengerProcessedData = new List <PassengerProcessedData>();

            foreach (var passenger in passengers)
            {
                ProcessDataFactory factory = null;
                switch (passenger.MembershipType)
                {
                case MembershipType.general:
                    factory = new GeneralPassengerFactory(passenger, route);
                    break;

                case MembershipType.airline:
                    factory = new AirlinePassengerFactory(passenger, route);
                    break;

                case MembershipType.loyalty:
                    factory = new LoyaltyPassengerFactory(passenger, route);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                PassengerData passengerData = factory.GetPassengerData();
                if (passengerData != null)
                {
                    passengerProcessedData.Add(new PassengerProcessedData()
                    {
                        Bags             = passengerData.TotalBags,
                        LoyaltyPointUsed = passengerData.LoyaltyPointUsed,
                        ProcessedRevnue  = passengerData.TicketPrice
                    });
                }
            }

            return(passengerProcessedData);
        }