Exemplo n.º 1
0
 /// <summary>
 /// Method for Singelton Management
 /// </summary>
 public static StaffManager Instance(List <Table> tables = null)
 {
     lock (padlock)
     {
         if (instance == null)
         {
             instance = new StaffManager(tables);
         }
         return(instance);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Take the client's order
        /// </summary>
        /// <param name="clients"></param>
        public void TakeOrderTable(ClientGroup clients)
        {
            this.IsAvailable = false;
            Position nextClient = new Position(clients.Position.posX - 20, clients.Position.posY);

            MoveTeleport(nextClient);

            if (clients.MealProgression == RecipeType.MAIN)
            {
                //Takes dessert orders for those who order in two times
                foreach (Client.Client clt in clients.ClientList)
                {
                    if (clt.OrderMethod.Name == "two")
                    {
                        Dish dish = new Dish();
                        dish.Recipe = clt.Order[2];
                        clients.tableOrder.Dishes.Add(dish);
                    }
                }
            }
            else
            {
                foreach (Client.Client clt in clients.ClientList)
                {
                    for (int i = 0; i < clt.Order.Length; i++)
                    {
                        Dish dish = new Dish();
                        if (clt.Order[i] != null)
                        {
                            dish.Recipe = clt.Order[i];
                            clients.tableOrder.Dishes.Add(dish);
                        }
                    }
                }
            }

            LogWriter.GetInstance().Write("Commande du groupe " + clients.Id + " passée");

            StaffManager.Instance().Counter.SendOrder(clients.tableOrder);
            this.IsAvailable = true;
        }