예제 #1
0
        public void tick()
        {
            if (GameInstance != null)
            {
                if (GameInstance.getReviews().Length > 0)
                {
                    // int year = (int)(TimeHelper.Quarters(Planetarium.GetUniversalTime()));
                    int year = (int)(TimeHelper.Periods(Planetarium.GetUniversalTime(), HighLogic.CurrentGame.Parameters.CustomParams <StateFundingSettings>().budgetPeriodsPerYear));
                    if (year > ReviewMgr.LastReview().year)
                    {
                        Log.Info("Happy New Quarter!");
                        if ((HighLogic.CurrentGame.Parameters.CustomParams <StateFundingSettings>().stopWarpAtBudgetPeriod&& TimeWarp.fetch != null) ||
                            (HighLogic.CurrentGame.Parameters.CustomParams <StateFundingSettings>().stopWarpOnNewYear&& year % HighLogic.CurrentGame.Parameters.CustomParams <StateFundingSettings>().budgetPeriodsPerYear == 0))
                        {
                            TimeWarp.fetch.CancelAutoWarp();
                            TimeWarp.SetRate(0, false);
                        }

                        ReviewMgr.CompleteReview();
                    }
                }
            }
        }
예제 #2
0
 public void UpdateYear()
 {
     Log.Info("Updating Year");
     //year = TimeHelper.Quarters(Planetarium.GetUniversalTime());
     year = TimeHelper.Periods(Planetarium.GetUniversalTime(), HighLogic.CurrentGame.Parameters.CustomParams <StateFundingSettings>().budgetPeriodsPerYear);
 }