public static void CookVegitable(Vegetable vegitable, Chef chef) { Potato potato = new Potato(); bool isCookable = IsCookable(potato); if (isCookable) { chef.Cook(potato); } else { throw new ArgumentException("The Vegitable be not rotten and peeled!"); } }
public void Cook() { Bowl bowl = this.GetBowl(); Potato potato = this.GetPotato(); Carrot carrot = this.GetCarrot(); this.Peel(potato); this.Peel(carrot); this.Cut(potato); this.Cut(carrot); bowl.Add(carrot); bowl.Add(potato); }