AK.F1.Timing.Live.LiveMessageTranslator.TranslateSetQuallyTimeValue C# (CSharp) Method

TranslateSetQuallyTimeValue() private method

private TranslateSetQuallyTimeValue ( SetGridColumnValueMessage message, int quallyNumber ) : Message
message AK.F1.Timing.Messages.Driver.SetGridColumnValueMessage
quallyNumber int
return Message
        private Message TranslateSetQuallyTimeValue(SetGridColumnValueMessage message, int quallyNumber)
        {
            var driver = GetDriver(message);

            if(!(IsQuallySession && driver.IsOnTrack))
            {
                return null;
            }
            var time = LiveData.ParseTime(message.Value);
            // We do not receive lap times during a qually session so we simulate them using the qually times.
            // Note that this is not a complete solution as we only receive qually times when the driver
            // improves upon thier time (hence the use of PostedTimeType.PersonalBest).
            // TODO we could keep track of the best time and promote the time to session best.
            return new CompositeMessage(
                new SetDriverQuallyTimeMessage(message.DriverId, quallyNumber, time),
                new SetDriverLapTimeMessage(message.DriverId,
                    new PostedTime(time, PostedTimeType.PersonalBest, driver.LapNumber)));
        }