Esempio n. 1
0
        private void HandleLapUIUpdateMessage(LapUIUpdateMessage lapMsg)
        {
            if (lapMsg.StintNumber < 0)
            {
                return;
            }
            if (!_mostRecentSessionTime.IsValid())
            {
                return;
            }

            var stopTime = GetMinimumPitStopLength(lapMsg.StintLapNumber + 1, lapMsg.StintNumber == 0, _mostRecentSessionTime, _sessionLength);

            var row = myList.OriginalList.FirstOrDefault(x => x.ItemID == lapMsg.ItemID);

            if (row == null)
            {
                return;
            }
            if (row.BlockUpdates)
            {
                return;
            }

            base.UpdateTimeDataTypeValue(row.MinimumPitStopTime, row, nameof(PitStopScoreboardDataContainer.MinimumPitStopTime), stopTime);
            row.StintLength = lapMsg.StintLapNumber + 1;
        }
        private void HandleLapUIUpdateMessage(LapUIUpdateMessage lapMsg)
        {
            // use this void to process lap information
            //in this case we are going to update the number of car passed at the end of each lap
            var car = myList.OriginalList.FirstOrDefault(x => x.CarID == lapMsg.ItemID);

            if (car == null || lapMsg.NumberOfCarsPassed == int.MaxValue)
            {
                return; //there is no car on the list that correspond to the item in the message
                // or the number of car passed has not been set
            }

            car.CarPassed = lapMsg.NumberOfCarsPassed;
        }