static void PlayWithDuck(Duck duck) { DrawDuck(duck); duck.Quack(); duck.Fly(); duck.Dance(); Console.WriteLine(); }
private static void SimulateDuck(Duck duck) { if (duck == null) { return; } Console.WriteLine(duck.GetType().Name); duck.Dance(); duck.Display(); duck.Fly(); duck.Quack(); duck.Swim(); Console.WriteLine(); }