Пример #1
0
    public static void UpdateGameStats()
    {
        List <int> numAcquiredStarsByWeek = new List <int>();
        int        _numDaysCompleted      = 0;

        for (int i = 0; i < numTotalDays; i++)                  // "i" represents the day
        {
            int weekIndex = i / 5;
            for (int week = 0; week < numTotalDays / 5; week++)
            {
                numAcquiredStarsByWeek.Add(0);
            }                                                           // add a "0" to the list for each week

            if (SaveGame.GetHasCompletedAllRoundsInDay(i))              // if all rounds within have been completed...
            {
                _numDaysCompleted = i + 1;                              // count it as a completed day
            }
            // if it's the first day, if all rounds have been completed, or if it's one day after an allroundscompleted day...
            if (i == 0 || SaveGame.GetHasCompletedAllRoundsInDay(i) || SaveGame.GetHasCompletedAllRoundsInDay(i - 1))
            {
                for (int j = 0; j < numAppointmentsPerDay[i]; j++)
                {
                    numAcquiredStarsByWeek[weekIndex] += SaveGame.GetRoundStarCount(i, j);                              // add each star from each round individually
                }
            }
        }

        // save out updated globals
        numStarsAcquiredPerWeek = numAcquiredStarsByWeek;
        numStarsAcquired        = AddAllItemsInList(numAcquiredStarsByWeek);
        numDaysCompleted        = _numDaysCompleted;

        Achievements.CheckForNewAchievements();
    }