Example #1
0
 public void buscaEmployeeDisponivel(Client c, bool tosa)
 {
     foreach (var g in employees)
     {
         Employee e = g.GetComponent <Employee>();
         if (e.tookRequest(c) == true)
         {
             //Debug.Log("o cliente " + c.Id + " achou alguem disponivel para fazer o pedido");
             if (!tosa)
             {
                 clients.Dequeue();
             }
             else
             {
                 PreferredClients.Dequeue();
             }
             break;
         }
     }
 }
Example #2
0
 private void Update()
 {
     if (clients.Count > 0 || PreferredClients.Count > 0)
     {
         Client c;
         if (PreferredClients.Count > 0)
         {
             c = PreferredClients.First();
             buscaEmployeeDisponivel(c, true);
         }
         else
         {
             c = clients.First();
             buscaEmployeeDisponivel(c, false);
         }
     }
     else if (workPeriodEnded)
     {
         //Debug.Log("qtd de clientes atendidos no dia: " + ClientsServed.Count);
         generateRecord();
     }
 }