public bool Move() { while (it.Move()) { canMoveChild = it.Current().Move(); if (!canMoveChild) { continue; } return(true); } return(false); }
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); }
public virtual bool Move() { return(it.Move()); }