Esempio n. 1
0
        private void UpdateResultsName(ChampionshipDto championship)
        {
            var driverDictionary = championship.GetGuidToDriverDictionary();

            foreach (var driverResult in championship.GetAllResults().SelectMany(x => x.DriverSessionResult))
            {
                driverResult.DriverName = driverDictionary[driverResult.DriverGuid].LastUsedName;
            }
        }
Esempio n. 2
0
        public void CommitLastSessionResults(ChampionshipDto championship)
        {
            var currentEvent         = championship.GetCurrentOrLastEvent();
            var currentSession       = currentEvent.Sessions[championship.CurrentSessionIndex];
            var guidDriverDictionary = championship.GetGuidToDriverDictionary();

            if (currentSession.SessionResult == null)
            {
                return;
            }

            foreach (DriverSessionResultDto driverSessionResultDto in currentSession.SessionResult.DriverSessionResult)
            {
                DriverDto driverDto = guidDriverDictionary[driverSessionResultDto.DriverGuid];
                driverDto.TotalPoints = driverSessionResultDto.TotalPoints;
                driverDto.Position    = driverSessionResultDto.AfterEventPosition;
            }
            AdvanceChampionship(championship);
        }