public static uint GetActualDay(int day, Season season) { if (day == 0) { return(0); } uint length = SeasonsManager.GetSeasonLength(season); if (day > 0) { if (day > length) { return(0); } } else { day = ((int)length + day); if (day < 0) { return(0); } } return((uint)day); }
public static uint GetActualDay(int day, Season season) { if (day == 0) { return(0); } uint length = SeasonsManager.GetSeasonLength(season); if (day > 0) { if (day > length) { return(0); } } else { day = ((int)length + day) + 1; // +1 fixes last day of season issue but breaks holidays again if (day < 0) { return(0); } } return((uint)day); }
public static int GetCurrentSeasonDay() { if (!SeasonsManager.Enabled) { return(0); } DateAndTime currentTime = SimClock.Subtract(SimClock.CurrentTime(), TimeUnit.Hours, SimClock.CurrentTime().Hour); // Number of remaining days int num = ((int)SimClock.ElapsedTime(TimeUnit.Days, currentTime, SeasonsManager.ExpectedEndTime)); return((int)SeasonsManager.GetSeasonLength(SeasonsManager.CurrentSeason) - num); }