예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
파일: Tempest.cs 프로젝트: yakoder/NRaas
        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);
        }