Exemple #1
0
 private rF2VehicleScoring getVehicleInfo(CrewChiefV4.rFactor2.RF2SharedMemoryReader.RF2StructWrapper shared)
 {
     for (int i = 0; i < shared.scoring.mScoringInfo.mNumVehicles; ++i)
     {
         var vehicle = shared.scoring.mVehicles[i];
         if (vehicle.mIsPlayer == 1)
         {
             return(vehicle);
         }
     }
     throw new Exception("no vehicle for player!");
 }
 private bool tryGetVehicleInfo(CrewChiefV4.rFactor2.RF2SharedMemoryReader.RF2StructWrapper shared, out rF2VehicleScoring vehicleScoring)
 {
     for (int i = 0; i < shared.scoring.mScoringInfo.mNumVehicles; ++i)
     {
         if (shared.scoring.mVehicles[i].mIsPlayer == 1)
         {
             vehicleScoring = shared.scoring.mVehicles[i];
             return(true);
         }
     }
     vehicleScoring = default(rF2VehicleScoring);
     return(false);
 }