Esempio n. 1
0
 public void SendIdleCustomerToQueue()
 {
     if (counterQueue.ListOfCustomersInQ.Count < counterQueue.ListOfPoints.Count && ListOfCustomersWandering.Count > 0)
     {
         NewCustomer customer = ListOfCustomersWandering[0];
         ListOfCustomersWandering.Remove(customer);
         customer.Target.Free = true;
         counterQueue.AddCustomer(customer);
     }
 }
Esempio n. 2
0
        // 2. Each x seconds (as defind in GameStarter script) 1 customer enters the store, moves to a pre defined free random point and stops
        public void AddCustomer(NewCustomer customer)
        {
            ListOfCustomersWandering.Add(customer);

            bool freePointFound = false;


            while (!freePointFound)
            {
                NewPoint point = ListOfMovePoints[Random.Range(0, 10)];

                if (point.Free)
                {
                    customer.PlaceAtPoint(startingPoint);
                    customer.MoveTo(point);
                    point.Free     = false;
                    freePointFound = true;
                }
            }
        }