Exemple #1
0
        private Potato GetPotato()
        {
            Potato potato = new Potato();

            this.cookingLog.Add(string.Format("Found a {0}. (The last one, the day is ours.)", potato));

            return(potato);
        }
Exemple #2
0
        public static void Main()
        {
            Chef cooker = new Chef();
            Potato potato = new Potato();

            if (potato != null && potato.IsPeeled && potato.IsRotten)
            {
                cooker.Cook(potato);
            }
        }
Exemple #3
0
        public static void Main()
        {
            Chef   cooker = new Chef();
            Potato potato = new Potato();

            if (potato != null && potato.IsPeeled && potato.IsRotten)
            {
                cooker.Cook(potato);
            }
        }
Exemple #4
0
        /// <summary>
        /// Describes the sequence of steps necessary to complete
        /// the soup-making process.
        /// </summary>
        public void MakeSoup()
        {
            Pot pot = this.GetPot();

            this.FillWithWater(pot);

            Potato potato = this.GetPotato();

            if (!potato.IsRotten)
            {
                if (!potato.IsPeeled)
                {
                    this.Peel(potato);
                }

                this.Wash(potato);
                this.Cut(potato);
            }
            else
            {
                this.MaybeNextTime(potato);
                return;
            }

            Carrot carrot = this.GetCarrot();

            if (!carrot.IsRotten)
            {
                if (!carrot.IsPeeled)
                {
                    this.Peel(carrot);
                }

                this.Wash(carrot);
                this.Cut(carrot);
            }
            else
            {
                this.MaybeNextTime(carrot);
                return;
            }

            this.PutIn(pot, potato);
            this.PutIn(pot, carrot);

            this.Boil(30);

            this.Success();
            return;
        }
Exemple #5
0
        public void Cook()
        {
            Potato potato = this.GetPotato();
            Carrot carrot = this.GetCarrot();

            Peel(potato);
            Peel(carrot);
            this.Cut(potato);
            this.Cut(carrot);
            Bowl bowl = this.GetBowl();

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

            Potato potato = GetPotato();

            Peel(potato);
            Cut(potato);
            bowl.Add(potato);

            Carrot carrot = GetCarrot();

            Peel(carrot);
            Cut(carrot);
            bowl.Add(carrot);
        }
Exemple #7
0
        public Bowl Cook()
        {
            Potato potato = GetPotato();

            Peel(potato);
            Cut(potato);

            Carrot carrot = GetCarrot();

            Peel(carrot);
            Cut(carrot);

            Bowl bowl = GetBowl();

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

            return(bowl);
        }
        static void Main()
        {
            var potato = new Potato();
            if (potato != null)
            {
                if (potato.IsPeeled && potato.IsFresh)
                {
                    Cook(potato);
                }
            }

            int row = int.Parse(Console.ReadLine());
            int column = int.Parse(Console.ReadLine());
            bool rowIsInner = (row >= MIN_ROW) && (row <= MAX_ROW);
            bool columnIsInner = (column >= MIN_COLUMN) && (column <= MAX_COLUMN);

            if (rowIsInner && columnIsInner)
            {
                VisitCell();
            }
        }
Exemple #9
0
        /// <summary>
        /// The entry point of the application.
        /// </summary>
        public static void Main()
        {
            Chef gordonRamsey = new Chef();

            Vegetable potato = new Potato(true);
            Vegetable carrot = new Carrot(true, false, false);

            gordonRamsey.Peel(potato);
            gordonRamsey.Peel(carrot);

            gordonRamsey.Cut(carrot);

            gordonRamsey.PutInBowl(potato);
            gordonRamsey.PutInBowl(carrot);

            foreach (Vegetable vegetable in gordonRamsey.VegitablesInBowl)
            {
                Console.WriteLine(vegetable.ToString());
                Console.WriteLine();
            }
        }
Exemple #10
0
        /// <summary>
        /// The entry point of the application.
        /// </summary>
        public static void Main()
        {
            Chef gordonRamsey = new Chef();

            Vegetable potato = new Potato(true);
            Vegetable carrot = new Carrot(true, false, false);

            gordonRamsey.Peel(potato);
            gordonRamsey.Peel(carrot);

            gordonRamsey.Cut(carrot);

            gordonRamsey.PutInBowl(potato);
            gordonRamsey.PutInBowl(carrot);

            foreach (Vegetable vegetable in gordonRamsey.VegitablesInBowl)
            {
                Console.WriteLine(vegetable.ToString());
                Console.WriteLine();
            }
        }
Exemple #11
0
        private Potato GetPotato()
        {
            Potato potato = new Potato();
            this.cookingLog.Add(string.Format("Found a {0}. (The last one, the day is ours.)", potato));

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