public void Main()
        {
            /*
             * Potato potato;
             * //...
             * if (potato != null)
             * if(!potato.HasNotBeenPeeled && !potato.IsRotten)
             * Cook(potato);
             *
             */

            Potatoe potato = new Potatoe();

            if (potato != null)
            {
                bool notPeeled = !potato.IsPeeled;
                bool notRotten = !potato.IsRotten;

                if (notPeeled && notRotten)
                {
                    potato.Cook();
                }
            }

            /*
             * if (x >= MIN_X && (x =< MAX_X && ((MAX_Y >= y &&
             * MIN_Y <= y) && !shouldNotVisitCell)))
             * {
             * VisitCell();
             * }
             */
            const int MinX = 5;
            const int MaxX = 15;
            const int MinY = 5;
            const int MaxY = 15;

            int x = 7;
            int y = 8;

            bool shouldVisitCell = true;

            if (shouldVisitCell && IsInRange(x, MinX, MaxX) && IsInRange(y, MinY, MaxY))
            {
                VisitCell();
            }
        }
        public void Main()
        {
            /*
               Potato potato;
               //...
               if (potato != null)
               if(!potato.HasNotBeenPeeled && !potato.IsRotten)
               Cook(potato);
             *
               */

            Potatoe potato = new Potatoe();

            if (potato != null)
            {
                bool notPeeled = !potato.IsPeeled;
                bool notRotten = !potato.IsRotten;

                if (notPeeled && notRotten)
                {
                    potato.Cook();
                }
            }

            /*
               if (x >= MIN_X && (x =< MAX_X && ((MAX_Y >= y &&
               MIN_Y <= y) && !shouldNotVisitCell)))
               {
               VisitCell();
               }
               */
            const int MinX = 5;
            const int MaxX = 15;
            const int MinY = 5;
            const int MaxY = 15;

            int x = 7;
            int y = 8;

            bool shouldVisitCell = true;

            if (shouldVisitCell && IsInRange(x, MinX, MaxX) && IsInRange(y, MinY, MaxY))
            {
                VisitCell();
            }
        }
Beispiel #3
0
        public Bowl Cook()
        {
            Potatoe potato = this.GetPotato();

            this.Peel(potato);
            this.Cut(potato);

            Carrot carrot = this.GetCarrot();

            this.Peel(carrot);
            this.Cut(carrot);

            Bowl bowl = this.GetBowl();

            bowl.Add(potato);
            bowl.Add(carrot);

            return(bowl);
        }
Beispiel #4
0
 public void BuildPotatoe(Potatoe pt) => meal.Potatoe = pt;