Exemple #1
0
        public void PrintVegetarianMenu()
        {
            IEnumerator <MenuComponent> iterator = _menuComponent.CreateIterator();

            Console.WriteLine("\n VEGETARIAN MENU \n --------");
            while (iterator.MoveNext())
            {
                MenuComponent menuComponent = iterator.Current;
                menuComponent.Print();
            }
        }
Exemple #2
0
        public static void Start(MenuComponent component)
        {
            var componentIterator = component.CreateIterator();

            CompositeIterator iterator = new CompositeIterator(componentIterator);

            while (iterator.MoveNext())
            {
                MenuComponent innerComponent = iterator.Current as MenuComponent;
            }
        }