public static bool Prefix(SessionStrategy __instance, SessionDetails.SessionType inSessionType, ref TyreSet __result)
 {
     if (inSessionType == SessionDetails.SessionType.Practice)
     {
         __result = __instance.GetTyreInBestCondition(SessionStrategy.TyreOption.First, null);
         return(false);
     }
     return(true);
 }
            public static bool Prefix(SessionSetup __instance, ref SessionPitstop ___mSessionPitStop, ref Driver ___mDriver, ref RacingVehicle ___mVehicle)
            {
                SessionDetails.SessionType sessionType = Game.instance.sessionManager.eventDetails.currentSession.sessionType;
                bool qualifyingBasedActive             = ___mDriver.contract.GetTeam().championship.rules.qualifyingBasedActive;
                bool flag  = false;
                bool flag2 = false;

                if (___mVehicle.practiceKnowledge.practiceReport != null)
                {
                    PracticeReportKnowledgeData knowledgeOfType  = ___mVehicle.practiceKnowledge.practiceReport.GetKnowledgeOfType(PracticeReportSessionData.KnowledgeType.QualifyingTrim);
                    PracticeReportKnowledgeData knowledgeOfType2 = ___mVehicle.practiceKnowledge.practiceReport.GetKnowledgeOfType(PracticeReportSessionData.KnowledgeType.RaceTrim);
                    flag  = (knowledgeOfType.normalizedKnowledge >= 1f);
                    flag2 = (knowledgeOfType2.normalizedKnowledge >= 1f);
                }
                switch (sessionType)
                {
                case SessionDetails.SessionType.Practice:
                    if (qualifyingBasedActive && !flag && flag2)
                    {
                        ___mSessionPitStop.currentSetup.trim        = SessionSetup.Trim.Qualifying;
                        ___mSessionPitStop.targetSetup.trim         = SessionSetup.Trim.Qualifying;
                        ___mVehicle.practiceKnowledge.knowledgeType = PracticeReportSessionData.KnowledgeType.QualifyingTrim;
                    }
                    else
                    {
                        ___mSessionPitStop.currentSetup.trim        = SessionSetup.Trim.Race;
                        ___mSessionPitStop.targetSetup.trim         = SessionSetup.Trim.Race;
                        ___mVehicle.practiceKnowledge.knowledgeType = PracticeReportSessionData.KnowledgeType.RaceTrim;
                    }
                    break;

                case SessionDetails.SessionType.Qualifying:
                    ___mSessionPitStop.currentSetup.trim = SessionSetup.Trim.Qualifying;
                    ___mSessionPitStop.targetSetup.trim  = SessionSetup.Trim.Qualifying;
                    break;

                case SessionDetails.SessionType.Race:
                    ___mSessionPitStop.currentSetup.trim = SessionSetup.Trim.Race;
                    ___mSessionPitStop.targetSetup.trim  = SessionSetup.Trim.Race;
                    break;
                }
                return(false);
            }