Exemplo n.º 1
0
 public static IRacingDataModel GetSerializedData(this IRacingSDK racingSDK)
 {
     if (racingSDK.IsConnected())
     {
         var fileView = IRacingSDK.GetFileMapView(racingSDK);
         var headers  = IRacingSDK.GetVarHeaders(racingSDK);
         var data     = new byte[racingSDK.Header.BufferLength];
         fileView.ReadArray(racingSDK.Header.Offset, data, 0, racingSDK.Header.BufferLength);
         return(IRacingDataModel.Serialize(data, headers));
     }
     return(null);
 }
Exemplo n.º 2
0
 public static List <CarModel> GetPositions(this IRacingSDK racingSDK, out double sessionTime)
 {
     if (racingSDK.IsConnected())
     {
         var fileView = IRacingSDK.GetFileMapView(racingSDK);
         var headers  = IRacingSDK.GetVarHeaders(racingSDK);
         var data     = new byte[racingSDK.Header.BufferLength];
         fileView.ReadArray(racingSDK.Header.Offset, data, 0, racingSDK.Header.BufferLength);
         sessionTime = (double)racingSDK.GetData("SessionTime");
         return(IRacingDataModel.SerializeCars(data, headers));
     }
     sessionTime = 0;
     return(null);
 }