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); } }
// 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; } } }