Exemple #1
0
        public void Cook()
        {
            Bowl   bowl   = this.GetBowl();
            Potato potato = this.GetPotato();
            Carrot carrot = this.GetCarrot();

            this.Peel(potato);
            this.Peel(carrot);

            this.Cut(potato);
            this.Cut(carrot);

            bowl.Add(carrot);
            bowl.Add(potato);
        }
        public static void Main()
        {
            Cook   cook   = new Cook();
            Potato potato = new Potato();
            Carrot carrot = new Carrot();
            Bowl   bowl   = new Bowl();

            cook.PeelVegetables(carrot);
            cook.PeelVegetables(potato);
            cook.CutVegetables(carrot);
            cook.CutVegetables(potato);

            bowl.Add(carrot);
            bowl.Add(potato);
        }
Exemple #3
0
        public void Cook()
        {
            Bowl bowl = GetBowl();

            Potato potato       = GetPotato();
            Potato peeledPotato = Peel(potato);
            Potato cutPotato    = Cut(peeledPotato);

            bowl.Add(cutPotato);

            Carrot carrot       = GetCarrot();
            Carrot peeledCarrot = Peel(carrot);
            Carrot cutCarrot    = Cut(peeledCarrot);

            bowl.Add(cutCarrot);
        }
Exemple #4
0
        public void Cook(Vegetable vegetable)
        {
            Potato potato = GetPotato();
            Carrot carrot = GetCarrot();
            Bowl   bowl;

            Peel(potato);
            Peel(carrot);

            bowl = GetBowl();

            Cut(potato);
            Cut(carrot);

            bowl.Add(carrot);
            bowl.Add(potato);
        }
Exemple #5
0
        public static void Main(string[] args)
        {
            Potato potato = new Potato();
            Chef chef = new Chef();

            if (potato == null)
            {
                throw new NullReferenceException();
            }
            else
            {
                if (potato.HasBeenPeeled && !potato.IsRotten)
                {
                    chef.Cook(potato);
                }
            }
        }
Exemple #6
0
        public static void Main(string[] args)
        {
            Potato potato = new Potato();
            Chef   chef   = new Chef();

            if (potato == null)
            {
                throw new NullReferenceException();
            }
            else
            {
                if (potato.HasBeenPeeled && !potato.IsRotten)
                {
                    chef.Cook(potato);
                }
            }
        }
        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();
            }
        }
Exemple #8
0
        private Potato GetPotato()
        {
            Potato potato = new Potato();

            return(potato);
        }
Exemple #9
0
 private Potato GetPotato()
 {
     Potato potato = new Potato();
     return potato;
 }