Пример #1
0
 public bool Move()
 {
     while (it.Move())
     {
         canMoveChild = it.Current().Move();
         if (!canMoveChild)
         {
             continue;
         }
         return(true);
     }
     return(false);
 }
Пример #2
0
 public InfiniteIterator(IIterator <T> it) : base(it)
 {
     it.Reset();
     if (!it.Move())
     {
         throw new ArgumentException("Passed iterator is empty");
     }
     it.Reset();
 }
        protected TripDay[] PrepareTrip(int days)
        {
            TripDay[] trip = new TripDay[days];
            for (int i = 0; i < days; i++)
            {
                Attraction[] attr = new Attraction[3];

                for (int j = 0; j < 3; j++)
                {
                    attractions.Move();
                    AttractionData a = attractions.Current();
                    attr[j] = new Attraction(int.Parse(a.Price), int.Parse(a.Rating), a.Name);
                }

                rooms.Move();
                RoomData r    = rooms.Current();
                Room     room = new Room(int.Parse(r.Price), int.Parse(r.Rating), r.Name);

                trip[i] = new TripDay(room, attr);
            }
            return(trip);
        }
Пример #4
0
 public virtual bool Move()
 {
     return(it.Move());
 }