Пример #1
0
        public bool Equals(TourTime other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(other.Index == Index);
        }
Пример #2
0
        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;
                }
            }
        }