Cook() публичный Метод

public Cook ( ) : void
Результат void
        private Meal MakeKiddieMeal()
        {
            _mealBuilder = new KiddieMeal();
            _chef.Cook(_mealBuilder);
            var kiddieMeal = _mealBuilder.ServeMeal();

            return(kiddieMeal);
        }
Пример #2
0
        public void Main()
        {
            // first task
            Potato potato = new Potato();

            if (IsValid(potato))
            {
                var IsReadyToCook = potato.ThereVegetablePeel && potato.IsCut;
                if (IsReadyToCook)
                {
                    var chef = new Chef();
                    chef.Cook(potato);
                }
            }

            // second task
            bool shouldVisitCell = true;
            int  horizontal      = 5;
            int  vertical        = 5;
            int  maxHorizontal   = 10;
            int  maxVertical     = 10;

            bool hasCorrectHorizontalValue = horizontal >= maxHorizontal && horizontal <= maxHorizontal;
            bool hasCorrectVerticalValue   = maxVertical >= vertical && maxVertical <= vertical;
            bool hasPremisionToVisitCell   = hasCorrectHorizontalValue && hasCorrectVerticalValue && shouldVisitCell;

            if (hasPremisionToVisitCell)
            {
                VisitCell();
            }
        }
Пример #3
0
        public static void Main()
        {
            var chef = new Chef();
            var bowl = chef.Cook();

            System.Console.WriteLine(bowl);
        }
Пример #4
0
 public void ProcessPotato(Potato potato)
 {
     if (potato != null && potato.IsPeeled && !potato.IsRotten)
     {
         chef.Cook(potato);
     }
 }
Пример #5
0
    public static void Main()
    {
        Chef chef = new Chef();

        Potato potato = new Potato();

        potato.IsRotten = false;

        if (potato != null)
        {
            // Potato will be peeled during Cook process, so this check is not necessary
            if (!potato.IsRotten)
            {
                chef.Cook(potato);
                Console.WriteLine("Potato is cooked!");
            }
            else
            {
                throw new ArgumentOutOfRangeException("Cannot cook rotten potato!");
            }
        }
        else
        {
            throw new ArgumentNullException("There is no potato!");
        }
    }
Пример #6
0
        public static void Main(string[] args)
        {
            Chef chef = new Chef();

            IIngredient[] list = new IIngredient[] { new Carrot(), new Potato() };
            chef.Cook(list);
        }
Пример #7
0
    public static void Main()
    {
        Chef chef = new Chef();

        Potato potato = new Potato();
        potato.IsRotten = false;

        if (potato != null)
        {
            // Potato will be peeled during Cook process, so this check is not necessary
            if (!potato.IsRotten)
            {
                chef.Cook(potato);
                Console.WriteLine("Potato is cooked!");
            }
            else
            {
                throw new ArgumentOutOfRangeException("Cannot cook rotten potato!");
            }
        }
        else
        {
            throw new ArgumentNullException("There is no potato!");
        }
    }
Пример #8
0
        public static void Main()
        {
            Chef chefNiko = new Chef();

            chefNiko.Cook();

            BoundsValidator someTestMatrix = new BoundsValidator();

            someTestMatrix.GoToCell(1, 1, false);
        }
Пример #9
0
        public static void Main()
        {
            var chef = new Chef("Salty Macannon");

            chef.Introduce();

            var carrot = chef.GetCarrot();
            var potato = chef.GetPotato();
            var bowl   = chef.GetBowl();

            chef.Cook(potato, carrot, bowl);
        }
Пример #10
0
        public static void Main()
        {
            Potato potato = new Potato();

            if (potato != null)
            {
                if (!(potato.HasNotBeenPeeled || potato.IsRotten))
                {
                    Chef masterChef = new Chef();
                    masterChef.Cook(potato);
                }
            }
        }
Пример #11
0
        public static Bowl ProcessVegetable(Vegetable vegetable, Chef chef)
        {
            bool isCookable = IsCookable(vegetable);

            if (isCookable)
            {
                return(chef.Cook(vegetable));
            }
            else
            {
                throw new ArgumentException("The vegetable must be peeled and not rotten in order to be cooked.");
            }
        }
 public static void Main()
 {
     Chef chef = new Chef();
     Potato potato = new Potato();
     if (potato == null)
     {
         throw new ArgumentNullException("Potato should be created.");
     }
     else if (potato.IsPeeled && potato.IsRotten)
     {
             chef.Cook(potato);
     }
 }
Пример #13
0
        public static void CookVegitable(Vegetable vegitable, Chef chef)
        {
            Potato potato = new Potato();

            bool isCookable = IsCookable(potato);

            if (isCookable)
            {
                chef.Cook(potato);
            }
            else
            {
                throw new ArgumentException("The vegitable should be peeled and shouldn't be rotten!");
            }
        }
Пример #14
0
        public static void PrepareMeal()
        {
            var potato = GetPotato();
            var chef   = new Chef();

            if (potato == null)
            {
                throw new ArgumentNullException();
            }

            if ((!potato.IsRotten) && (potato.IsPeeled))
            {
                var bowl = chef.Cook();
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Пример #15
0
        public static void PrepareMeal()
        {
            var potato = GetPotato();
            var chef = new Chef();

            if (potato == null)
            {
                throw new ArgumentNullException();
            }

            if((!potato.IsRotten)&&(potato.IsPeeled))
            {
                var bowl = chef.Cook();
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Пример #16
0
    private static void Main()
    {
        Chef gosho = new Chef("Georgi", "Oklahoma");

        Potato potato = new Potato(0.5, 0.3m);

        if (potato == null)
        {
            throw new ArgumentNullException("Vegetable item cannot be null");
        }

        if (!potato.IsPeeled && potato.IsRotten)
        {
            throw new ArgumentException(
                "Vegetable must be not rotten and peeled before cooking");
        }

        gosho.Cook(potato);
    }
 internal static void CookMeal(Chef chef, Potato potato, Carrot carrot)
 {
     if (potato != null && chef != null)
     {
         if (potato.IsPeeled && !potato.IsRotten)
         {
             chef.Cook(potato, carrot);
         }
         else
         {
             Console.WriteLine(chef.Name + " ANGRY!!! " + chef.Name + " SMASHHH!!!");
             Console.WriteLine("Don't you be givin me no rotten potatoes!");
             Console.ReadLine();
         }
     }
     else
     {
         Console.WriteLine("Where my potato AT!");
     }
 }
Пример #18
0
    public static void Main(string[] args)
    {
        Potato potato = new Potato();
        Chef   chef   = new Chef();

        // Refactor the following if statements:
        //Potato potato;
        ////...
        //if (potato != null)
        //    if (!potato.HasNotBeenPeeled && !potato.IsRotten)
        //        Cook(potato);

        if (potato != null)
        {
            if (potato.HasBeenPeeled && potato.IsFresh)
            {
                chef.Cook(potato);
            }
        }
    }
Пример #19
0
        public static void Main()
        {
            Potato potato = new Potato();
            Chef   chef   = new Chef();

            if (potato != null)
            {
                if (potato.IsGood && potato.HasBeenPeeled)
                {
                    chef.Cook(potato);
                }
                else
                {
                    // take new potato and peel it...
                }
            }
            else
            {
                // take some potato...
            }
        }
Пример #20
0
        public static void Main()
        {
            /*
             * Potato potato;
             * if (potato != null)
             *  if (!potato.HasNotBeenPeeled && !potato.IsRotten)
             *      Cook(potato);
             */
            Potato potato = new Potato();
            Chef   chef   = new Chef();

            potato.IsPeeled = true;
            potato.IsRotten = false;

            if (potato != null)
            {
                if (potato.IsPeeled && !potato.IsRotten)
                {
                    chef.Cook(potato);
                }
            }

            /*
             * if (x >= MIN_X && (x =< MAX_X && ((MAX_Y >= y && MIN_Y <= y) && !shouldNotVisitCell)))
             * {
             * VisitCell();
             * }
             */
            int x = 4;
            int y = 5;

            bool shouldVisitCell = true;

            if (InRange(x, y) && shouldVisitCell)
            {
                VisitCell();
            }
        }
Пример #21
0
    //  Minigame endings, except plating.
    #region EndMinigames

    public void EndEstufa(bool exito)
    {
        Debug.Log("Ganó juego de estufa: " + exito);

        miniJuegoEstufa.enabled = false;
        canvasEstufa.SetActive(false);

        GUI = false;


        exitoEstufa = true;
        // source.PlayOneShot(victory);

        if (exito)
        {
            cheffy.Cook();
        }
    }
Пример #22
0
    static void Main(string[] args)
    {
        Chef chef = new Chef();

        chef.Cook();
    }
Пример #23
0
 static void Main()
 {
     Chef chef = new Chef();
     chef.Cook();
 }
Пример #24
0
 public static void Main()
 {
     var chef = new Chef();
     chef.Cook();
 }
Пример #25
0
 public static void Main(string[] args)
 {
     Chef chef = new Chef();
     chef.Cook();
 }
        public static void Main(string[] args)
        {
            // Task 2. Refactor the following if statements
            Potato potato      = new Potato();
            Chef   chefManchev = new Chef();

            // ...
            if (potato != null)
            {
                if (!potato.HasNotBeenPeeled && !potato.IsRotten)
                {
                    chefManchev.Cook(potato);
                }
            }

            // Task 3. Refactor the following loop
            int x    = GetX();
            int xMax = 200;
            int xMin = 100;
            int y    = GetY();
            int yMax = 2000;
            int yMin = 1000;

            bool isValidX        = (x >= xMin) && (x <= xMax);
            bool isValidY        = (y >= yMin) && (y <= yMax);
            bool shouldVisitCell = true;

            if (isValidX && isValidY && shouldVisitCell)
            {
                VisitCell();
            }

            int[] arrayHoldingTheValues = new int[100];

            // Fillout the array with test values
            for (int i = 0; i < 100; i++)
            {
                arrayHoldingTheValues[i] = i + 1;
            }

            int  expectedValue   = 11;
            bool isFoundTheValue = false;

            // Traversing array and searching for the expextedValue
            for (int i = 0; i < 100; i++)
            {
                Console.WriteLine(arrayHoldingTheValues[i]);
                if (i % 10 == 0)
                {
                    if (arrayHoldingTheValues[i] == expectedValue)
                    {
                        isFoundTheValue = true;
                        break;
                    }
                }
            }

            // More code here
            if (isFoundTheValue)
            {
                Console.WriteLine("Value Found");
            }
        }
Пример #27
0
        public static void Main()
        {
            var chef = new Chef();

            chef.Cook();
        }
Пример #28
0
 public static void Main()
 {
     var chef = new Chef();
     var bowl = chef.Cook();
     System.Console.WriteLine(bowl);
 }
Пример #29
0
    private static void Main()
    {
        Chef hristo = new Chef("Ico", "VelikoSelo");

        hristo.Cook();
    }
Пример #30
0
        static void Main()
        {
            Chef chef = new Chef();

            chef.Cook();
        }
Пример #31
0
 public static void Main()
 {
     var chef = new Chef();
     var result = chef.Cook();
     result.Serve();
 }
Пример #32
0
        public static void Main()
        {
            Chef master = new Chef();

            master.Cook();
        }