WorldClock/Scripts/TimeData.cs
/// <summary>
/// Advances this TimeData forward to the next day at the given time. Calls the NewDay event. 
/// </summary>
/// <param name="startingHourOfNewDay">The hour to start the new day at</param>
/// <param name="startingMinuteOfNewDay">The minute to start the new day at</param>
Advances this TimeData forward to the next day at the given time. Calls the NewDay event.
Advances this TimeData forward to the next day at the given time . Calls the NewDay event .
public virtual void AdvanceToNextDayAtTime(int startingHourOfNewDay, int startingMinuteOfNewDay)
    {
        int sanitizedMinutes = SanitizeMinutes(startingMinuteOfNewDay);
        int sanitizedHours = SanitizeValue(startingHourOfNewDay, MyGlobalTime.hoursInADay);
        minutes = sanitizedMinutes;
        hours = sanitizedHours;
        if (days + 1 == MyGlobalTime.daysInAMonth)
        {
            days = 0;
            if (months + 1 == MyGlobalTime.monthsInAYear)
            {
                if (NewYear != null)
                    NewYear();
                months = 0;
                years += 1;
            }
            else
            {
                if (NewMonth != null)
                    NewMonth();
                months += 1;
            }
        }
        days += 1;
        if (NewDay != null)
            NewDay();
    }
public virtual void AdvanceToNextDayAtTime ( int startingHourOfNewDay , int startingMinuteOfNewDay ) { int sanitizedMinutes = SanitizeMinutes ( startingMinuteOfNewDay ) ; int sanitizedHours = SanitizeValue ( startingHourOfNewDay , MyGlobalTime . hoursInADay ) ; minutes = sanitizedMinutes ; hours = sanitizedHours ; if ( days + 1 == MyGlobalTime . daysInAMonth ) { days = 0 ; if ( months + 1 == MyGlobalTime . monthsInAYear ) { if ( NewYear != null ) NewYear ( ) ; months = 0 ; years += 1 ; } else { if ( NewMonth != null ) NewMonth ( ) ; months += 1 ; } } days += 1 ; if ( NewDay != null ) NewDay ( ) ; }
Advances this TimeData forward to the next day at the given time.
Advances this TimeData forward to the next day at the given time .
startingHourOfNewDay
int
The hour to start the new day at
The hour to start the new day at
startingMinuteOfNewDay
int
The minute to start the new day at
The minute to start the new day at