Ejemplo n.º 1
0
        private void HandleSectorUIUpdateMessage(SectorUIUpdateMessage sectorMsg)
        {
            if (sectorMsg.StintNumber < 0)
            {
                return;
            }
            if (!_mostRecentSessionTime.IsValid())
            {
                return;
            }

            var stopTime = GetMinimumPitStopLength(sectorMsg.StintLapNumber, sectorMsg.StintNumber == 0, _mostRecentSessionTime, _sessionLength);

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

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

            base.UpdateTimeDataTypeValue(row.MinimumPitStopTime, row, nameof(PitStopScoreboardDataContainer.MinimumPitStopTime), stopTime);
            row.StintLength = sectorMsg.StintLapNumber;
        }
        private void HandleSectorUIUpdateMessage(SectorUIUpdateMessage sectorMsg)
        {
            // use this void to process sector information
            //in this case we are going to find the car for the current message and update the sector exit time

            var car = myList.OriginalList.FirstOrDefault(x => x.CarID == sectorMsg.ItemID);

            if (car == null || sectorMsg.SectorExitTime == -1)
            {
                return; //there is no car on the list that correspond to the item in the message
            }

            car.LastSectorExitTime.SetValue(sectorMsg.SectorExitTime);
        }