public static void Main(string[] args) { Potato potato = new Potato(); potato.IsPilled = true; CookPotato(potato); if (CheckCellVisitable(60, 100, true)) { VisitCell(); } else { Console.WriteLine("Cell can't be visited!"); } }
public static void CookPotato(Potato potato) { if (potato != null) { if (potato.IsPilled && !potato.IsRotten) { Cook(potato); } else { Console.WriteLine("Potato can't be cooked!"); } } else { Console.WriteLine("Potato is null!"); } }
public static void Cook(Potato potato) { Console.WriteLine("Potato has been cooked!"); }