Exemple #1
0
        private Carrot GetCarrot()
        {
            Carrot carrot = new Carrot();

            this.cookingLog.Add(string.Format("Found a {0}. (Thank you, hamster.)", carrot));

            return(carrot);
        }
Exemple #2
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 #3
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 #4
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 #5
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);
        }
Exemple #6
0
        static void Main(string[] args)
        {
            IVegetable carrot = new Carrot();
            IVegetable patato = new Patato();
            IVegetable paper  = new Paper();

            IVegetable vegetables = new Vegetables();

            IAppearance bowl    = new Bowl();
            IAppearance steamer = new Steamer();

            Chef chef = new Chef();

            chef.Wash();
            chef.Cut();
            chef.Prepare(bowl);
            chef.Cook(steamer);
            chef.Serve();
        }
Exemple #7
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 #8
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 #9
0
        private Carrot GetCarrot()
        {
            Carrot carrot = new Carrot();
            this.cookingLog.Add(string.Format("Found a {0}. (Thank you, hamster.)", carrot));

            return carrot;
        }
Exemple #10
0
 private Carrot GetCarrot()
 {
     var carrot = new Carrot();
     return carrot;
 }