예제 #1
0
        static void Main(string[] args)
        {
            CocreteAggregate cocrete = new CocreteAggregate();

            cocrete[0] = "张三";
            cocrete[1] = "李四";
            cocrete[2] = "王五";
            cocrete[3] = "赵六";
            cocrete[4] = "刘七";

            Iterator i = new CocreteIterator(cocrete);

            i.First();
            while (!i.IsDone())
            {
                Console.WriteLine($"{i.CurrentItem().ToString()}的请买票");
                i.Next();
            }

            Console.Read();
        }
예제 #2
0
 public CocreteIterator(CocreteAggregate cocreteAggregate)
 {
     _cocreteAggregate = cocreteAggregate;
 }