public void CookDish() { Potato potato = this.GetPotato(); this.Peel(potato); this.Cut(potato); Carrot carrot = this.GetCarrot(); this.Peel(carrot); this.Cut(carrot); Bowl bowl = this.GetBowl(); bowl.Add(potato); bowl.Add(carrot); Console.WriteLine(bowl.ToString()); }
public static void Main() { /* Potato potato; if (potato != null) if (!potato.HasNotBeenPeeled && !potato.IsRotten) Cook(potato); */ Potato potato = new Potato(); Chef chef = new Chef(); potato.IsPeeled = true; potato.IsRotten = false; if (potato != null) { if (potato.IsPeeled && !potato.IsRotten) { chef.Cook(potato); } } /* if (x >= MIN_X && (x =< MAX_X && ((MAX_Y >= y && MIN_Y <= y) && !shouldNotVisitCell))) { VisitCell(); } */ int x = 4; int y = 5; bool shouldVisitCell = true; if (InRange(x, y) && shouldVisitCell) { VisitCell(); } }