private Carrot GetCarrot() { Carrot carrot = new Carrot(); this.cookingLog.Add(string.Format("Found a {0}. (Thank you, hamster.)", carrot)); return(carrot); }
/// <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; }
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); }
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); }
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(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(); }
/// <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(); } }
/// <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(); } }
private Carrot GetCarrot() { Carrot carrot = new Carrot(); this.cookingLog.Add(string.Format("Found a {0}. (Thank you, hamster.)", carrot)); return carrot; }
private Carrot GetCarrot() { var carrot = new Carrot(); return carrot; }