示例#1
0
        public bool CanMake(Pizza order)
        {
            bool res = true, deli = false;

            foreach (var i in order.Ingradients)
            {
                if (cargo.CanTakeIngradient(i) != 0)
                {
                    if (!cargo.IsOrderedd(i))
                    {
                        var massPrev = i.MassGr;
                        i.MassGr = 7500;
                        if (i.Name == IngradientLoader.Flour().Name || i.Name == IngradientLoader.Yeast().Name)
                        {
                            deli = true;
                        }
                        cargo.OrderIngradient(new Ingradient(i));
                        i.MassGr = massPrev;
                    }
                    res = false;
                }
            }
            if (deli)
            {
                cargo.OrderIngradient(null, deli);
            }
            return(res);
        }
示例#2
0
 void Init()
 {
     Console.SetWindowSize(Console.LargestWindowWidth - 2, Console.LargestWindowHeight - 2);
     Console.CursorVisible = false;
     //if (!IngradientLoader.IsIngradientsExist())
     IngradientLoader.CreateIngradientFile();
     //if (!PizzaLoader.IsPizzaExist())
     PizzaLoader.CreatePizzaFile();
 }
示例#3
0
 public void WeeklyDeliver()
 {
     foreach (var i in IngradientLoader.GetAll())
     {
         i.MassGr = 10000;
         cargo.OrderIngradient(i);
     }
     cargo.OrderIngradient(null, true);
 }
示例#4
0
        public void PripaxatPovarov()
        {
            if (cargo.GetIngMass(IngradientLoader.Flour()) <= 2000 && !cargo.IsOrderedd(IngradientLoader.Flour()))
            {
                var t = IngradientLoader.Flour();
                t.MassGr = 25000;
                cargo.OrderIngradient(t, true);
            }

            CheckSalary();
            if (orders.Count != 0)
            {
                foreach (var pizzaMaster in staff)
                {
                    if (orders.Count == 0)
                    {
                        break;
                    }
                    if (pizzaMaster.IsReady)
                    {
                        pizzaMaster.IsReady = false;
                        KitchenPizza order = orders.Dequeue();
                        //	RESTART:
                        //	try {
                        order.master         = pizzaMaster;
                        order.whenStart      = DateTime.Now;
                        order.piz.QualityMod = pizzaMaster.QualityMod;
                        for (int i = 0; i < order.piz.Ingradients.Length; ++i)
                        {
                            double prev = Money.value;
                            order.piz.Ingradients[i] = cargo.TakeIngradient(order.piz.Ingradients[i], ref Money.value);
                            order.piz.Price         += prev - Money.value;
                        }
                        order.piz.Price *= 1.5;

                        cooked.Add(order);
                        //	}
                        //	catch (Exception exc) {
                        //	foreach (var i in order.piz.Ingradients)
                        //		if(!cargo.IsOrderedd(i))
                        //			cargo.OrderIngradient(i);
                        //	cargo.OrderIngradient(null, true);
                        //order.who.RePickPizzas(this, order.piz);
                        //goto RESTART;
                        //}
                    }
                }
            }
            GivePizzaToCompany();
        }
示例#5
0
        static public Ingradient[] GetAll()
        {
            return(new Ingradient[] {
                IngradientLoader.Garlic(),
                IngradientLoader.Grass(),
                IngradientLoader.Fish(),
                IngradientLoader.Sausage(),
                IngradientLoader.Tomato(),
                IngradientLoader.Onion(),
                IngradientLoader.Cucumber(),
                IngradientLoader.Flour(),
                IngradientLoader.Yeast(),
                IngradientLoader.Ketchup(),
                IngradientLoader.TomatoSauce(),
                IngradientLoader.Mayonnaise(),

                SeeFood(),

                Crab(),

                Vetcina(),

                Becon(),

                Paperoni(),

                Salami(),
                Olives(),

                Mushroom(),

                BolgarPapper(),

                Oregano(),

                Pineapple(),
                Mozzarela(),
                ItalienCheese(),
                Parmezan(),
                Spice()
            });
        }
示例#6
0
        static public void CreatePizzaFile()
        {
            Directory.CreateDirectory(pizzaFolder);

            SerializePizza("ТестоваПіца№1", "Норм", new Ingradient[] {
                new Ingradient(IngradientLoader.Flour())
                {
                    MassGr = 300
                },
                new Ingradient(IngradientLoader.Yeast())
                {
                    MassGr = 10
                },
                new Ingradient(IngradientLoader.Grass())
                {
                    MassGr = 500
                },
                new Ingradient(IngradientLoader.Sausage())
                {
                    MassGr = 500
                }
            },
                           1
                           );
            SerializePizza("NullPizza", "Норм", new Ingradient[] {
                new Ingradient(IngradientLoader.Flour())
                {
                    MassGr = 0
                },
            },
                           1
                           );

            SerializePizza("АрМар", "Норм", new Ingradient[] {
                new Ingradient(IngradientLoader.Flour())
                {
                    MassGr = 500
                },
                new Ingradient(IngradientLoader.Yeast())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.TomatoSauce())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.Grass())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.Vetcina())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.ItalienCheese())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Becon())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Tomato())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Olives())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Paperoni())
                {
                    MassGr = 100
                },
            },
                           5
                           );
            SerializePizza("Венеция", "Норм", new Ingradient[] {
                new Ingradient(IngradientLoader.Flour())
                {
                    MassGr = 500
                },
                new Ingradient(IngradientLoader.Yeast())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.TomatoSauce())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.Grass())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.Vetcina())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.ItalienCheese())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Salami())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Becon())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Mushroom())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.BolgarPapper())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Tomato())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Spice())
                {
                    MassGr = 10
                },
            },
                           5
                           );
            SerializePizza("Папперони", "Норм", new Ingradient[] {
                new Ingradient(IngradientLoader.Flour())
                {
                    MassGr = 500
                },
                new Ingradient(IngradientLoader.Yeast())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.TomatoSauce())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.ItalienCheese())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Mushroom())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Olives())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Oregano())
                {
                    MassGr = 10
                },
                new Ingradient(IngradientLoader.Paperoni())
                {
                    MassGr = 10
                }
            },
                           5
                           );
            SerializePizza("Морская", "Норм", new Ingradient[] {
                new Ingradient(IngradientLoader.Flour())
                {
                    MassGr = 500
                },
                new Ingradient(IngradientLoader.Yeast())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.TomatoSauce())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.ItalienCheese())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Mushroom())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Spice())
                {
                    MassGr = 10
                },
                new Ingradient(IngradientLoader.Crab())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.SeeFood())
                {
                    MassGr = 100
                },
            },
                           5
                           );


            SerializePizza("Рико", "Норм", new Ingradient[] {
                new Ingradient(IngradientLoader.Flour())
                {
                    MassGr = 500
                },
                new Ingradient(IngradientLoader.Yeast())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.TomatoSauce())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.ItalienCheese())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Spice())
                {
                    MassGr = 10
                },
                new Ingradient(IngradientLoader.Pineapple())
                {
                    MassGr = 100
                },
            },
                           5
                           );
            SerializePizza("Сырная", "Норм", new Ingradient[] {
                new Ingradient(IngradientLoader.Flour())
                {
                    MassGr = 500
                },
                new Ingradient(IngradientLoader.Yeast())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.Mozzarela())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Parmezan())
                {
                    MassGr = 100
                },
            },
                           5
                           );
            SerializePizza("Грибной люкс", "Норм", new Ingradient[] {
                new Ingradient(IngradientLoader.Flour())
                {
                    MassGr = 500
                },
                new Ingradient(IngradientLoader.Yeast())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.TomatoSauce())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.ItalienCheese())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Spice())
                {
                    MassGr = 10
                },
                new Ingradient(IngradientLoader.Mushroom())
                {
                    MassGr = 100
                },
            },
                           5
                           );
            SerializePizza("Княжеская", "Норм", new Ingradient[] {
                new Ingradient(IngradientLoader.Flour())
                {
                    MassGr = 500
                },
                new Ingradient(IngradientLoader.Yeast())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.TomatoSauce())
                {
                    MassGr = 25
                },
                new Ingradient(IngradientLoader.ItalienCheese())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Spice())
                {
                    MassGr = 10
                },
                new Ingradient(IngradientLoader.Mushroom())
                {
                    MassGr = 100
                },
                new Ingradient(IngradientLoader.Tomato())
                {
                    MassGr = 100
                },
            },
                           5
                           );
            SerializePizza("Фокача", "Норм", new Ingradient[] {
                new Ingradient(IngradientLoader.Flour())
                {
                    MassGr = 500
                },
                new Ingradient(IngradientLoader.Yeast())
                {
                    MassGr = 25
                },
            },
                           5
                           );
        }