private void CheckCircuit(TelemetryPacket packet) { var circuit = CircuitRepository.GetByTrackLength(packet.TrackLength); if (circuit.Name != _currectCircuit.Name || _lapType != packet.SessionTypeName) { this.ChangeCircuit(circuit, packet.SessionTypeName); } }
public TelemetryLap(SerializationInfo info, StreamingContext context) { var trackLength = info.GetValue <float>("LapTrackLength"); Packets = info.GetValue <List <TelemetryPacket> >("Packets"); Circuit = CircuitRepository.GetByTrackLength(trackLength); LapType = info.GetValue <string>("LapType"); try { _hasFinished = info.GetValue <bool>("HasFinished"); } catch { _hasFinished = true; } }