示例#1
0
文件: Client.cs 项目: Team-on/works
        public void PickPizzas(Kitchen kitchen)
        {
            int pizzaCnt = Rand.rand.Next(1, 4);

            while (pizzaCnt-- != 0)
            {
                Pizza pizza;
                while (!kitchen.CanMake(pizza = PizzaLoader.RandomPizza()))
                {
                    ;
                }
                AddPizza(pizza);
            }
        }
示例#2
0
文件: Client.cs 项目: Team-on/works
 public void RePickPizzas(Kitchen kitchen, Pizza _pizza)
 {
     for (int i = 0; i < wantOrder.Count; i++)
     {
         if (wantOrder[i].Name == _pizza.Name)
         {
             wantOrder[i] = PizzaLoader.RandomPizza();
             int cnt = 0;
             while (!kitchen.CanMake(wantOrder[i] = PizzaLoader.RandomPizza()))
             {
                 if (++cnt > 1000)
                 {
                     wantOrder[i] = PizzaLoader.Fokacha();
                     break;
                 }
             }
         }
     }
 }