public void ReadDuckMenu(IIterator iterator) { int Item = 1; while (iterator.hasNext()) { Console.WriteLine("Элемент меню: " + Item); IBaseDuck baseDuck = (IBaseDuck)iterator.next(); baseDuck.Fly(); baseDuck.Quick(); baseDuck.Composition(); Console.WriteLine(); Item++; } }
public void ReadDuckMenu(IIterator iterator) { int item = 1; while (iterator.HasNext()) { Console.WriteLine("Элемент меню: " + item); IBaseDuck duck = iterator.Next(); duck.Fly(); duck.Quack(); duck.Walk(); Console.WriteLine(); item++; } }