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); //OR *depends on the specific case* Potato potato = GetPotato(); Peel(potato); Cut(potato); Carrot carrot = GetCarrot(); Peel(carrot); Cut(carrot); Bowl bowl = GetBowl(); bowl.Add(potato); bowl.Add(carrot); }
// Task 1 is in this file // Task 2 is in MainClass.cs public void Cook() { Bowl bowl = this.GetBowl(); Potato potato = this.GetPotato(); Potato peeledPotato = (Potato)this.Peel(potato); Potato cuttedPotato = (Potato)this.Cut(peeledPotato); bowl.Add(cuttedPotato); Carrot carrot = this.GetCarrot(); Carrot peeledCarrot = (Carrot)this.Peel(carrot); Carrot cuttedCarrot = (Carrot)this.Cut(peeledCarrot); bowl.Add(cuttedCarrot); }
private Bowl GetBowl() { var newBowl = new Bowl(); return newBowl; }