public bool Equals(TourTime other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(other.Index == Index); }
public static void InitializeTourTimes() { if (Times != null) { return; } Times = new TourTime[TOTAL_TOUR_TIMES]; var alternativeIndex = 0; for (var arrivalPeriodIndex = 0; arrivalPeriodIndex < DayPeriod.SmallDayPeriods.Length; arrivalPeriodIndex++) { for (var departurePeriodIndex = arrivalPeriodIndex; departurePeriodIndex < DayPeriod.SmallDayPeriods.Length; departurePeriodIndex++) { var time = new TourTime(alternativeIndex, DayPeriod.SmallDayPeriods[arrivalPeriodIndex], DayPeriod.SmallDayPeriods[departurePeriodIndex]); Times[alternativeIndex++] = time; } } }