Beispiel #1
0
    public void LoadTiresData(Wheel w, string tires)
    {
        tiresFound = true;
        if (tires == "competition_front")
        {
            System.Array.Copy(TireParameters.aCompetitionFront, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bCompetitionFront, w.b, w.b.Length);
            if (TireParameters.cCompetitionFront.Length != 0)
            {
                System.Array.Copy(TireParameters.cCompetitionFront, w.c, w.c.Length);
            }
        }
        else if (tires == "competition_rear")
        {
            System.Array.Copy(TireParameters.aCompetitionRear, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bCompetitionRear, w.b, w.b.Length);
            if (TireParameters.cCompetitionRear.Length != 0)
            {
                System.Array.Copy(TireParameters.cCompetitionRear, w.c, w.c.Length);
            }
        }
        else if (tires == "supersport_front")
        {
            System.Array.Copy(TireParameters.aSuperSportFront, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bSuperSportFront, w.b, w.b.Length);
            if (TireParameters.cSuperSportFront.Length != 0)
            {
                System.Array.Copy(TireParameters.cSuperSportFront, w.c, w.c.Length);
            }
        }
        else if (tires == "supersport_rear")
        {
            System.Array.Copy(TireParameters.aSuperSportRear, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bSuperSportRear, w.b, w.b.Length);
            if (TireParameters.cSuperSportRear.Length != 0)
            {
                System.Array.Copy(TireParameters.cSuperSportRear, w.c, w.c.Length);
            }
        }

        else if (tires == "sport_front")
        {
            System.Array.Copy(TireParameters.aSportFront, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bSportFront, w.b, w.b.Length);
            if (TireParameters.cSportFront.Length != 0)
            {
                System.Array.Copy(TireParameters.cSportFront, w.c, w.c.Length);
            }
        }
        else if (tires == "sport_rear")
        {
            System.Array.Copy(TireParameters.aSportRear, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bSportRear, w.b, w.b.Length);
            if (TireParameters.cSportRear.Length != 0)
            {
                System.Array.Copy(TireParameters.cSportRear, w.c, w.c.Length);
            }
        }
        else if (tires == "touring_front")
        {
            System.Array.Copy(TireParameters.aTouringFront, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bTouringFront, w.b, w.b.Length);
            if (TireParameters.cTouringFront.Length != 0)
            {
                System.Array.Copy(TireParameters.cTouringFront, w.c, w.c.Length);
            }
        }
        else if (tires == "touring_rear")
        {
            System.Array.Copy(TireParameters.aTouringRear, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bTouringRear, w.b, w.b.Length);
            if (TireParameters.cTouringRear.Length != 0)
            {
                System.Array.Copy(TireParameters.cTouringRear, w.c, w.c.Length);
            }
        }
        else if (tires == "offroad_front")              //OffRoad tires
        {
            System.Array.Copy(TireParameters.aOffRoadFront, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bOffRoadFront, w.b, w.b.Length);
            if (TireParameters.cOffRoadFront.Length != 0)
            {
                System.Array.Copy(TireParameters.cOffRoadFront, w.c, w.c.Length);
            }
        }
        else if (tires == "offroad_rear")               //OffRoad tires
        {
            System.Array.Copy(TireParameters.aOffRoadRear, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bOffRoadRear, w.b, w.b.Length);
            if (TireParameters.cOffRoadRear.Length != 0)
            {
                System.Array.Copy(TireParameters.cOffRoadRear, w.c, w.c.Length);
            }
        }
        else if (tires == "truck_front")        //Truck truck tires
        {
            System.Array.Copy(TireParameters.aTruckFront, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bTruckFront, w.b, w.b.Length);
            if (TireParameters.cTruckFront.Length != 0)
            {
                System.Array.Copy(TireParameters.cTruckFront, w.c, w.c.Length);
            }
        }
        else if (tires == "truck_rear")         //Truck truck tires
        {
            System.Array.Copy(TireParameters.aTruckRear, w.a, w.a.Length);
            System.Array.Copy(TireParameters.bTruckRear, w.b, w.b.Length);
            if (TireParameters.cTruckRear.Length != 0)
            {
                System.Array.Copy(TireParameters.cTruckRear, w.c, w.c.Length);
            }
        }
        else
        {
            tiresFound = false;
        }
        w.CalculateIdealSlipRatioIdealSlipAngle(20);
    }
	public void LoadTiresData(Wheel w, string tires){

		tiresFound=true;
 		if (tires=="competition_front"){
			System.Array.Copy(TireParameters.aCompetitionFront, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bCompetitionFront, w.b, w.b.Length);
			if (TireParameters.cCompetitionFront.Length!=0) System.Array.Copy(TireParameters.cCompetitionFront, w.c, w.c.Length);
		}
		else if (tires=="competition_rear"){
			System.Array.Copy(TireParameters.aCompetitionRear, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bCompetitionRear, w.b, w.b.Length);
			if (TireParameters.cCompetitionRear.Length!=0) System.Array.Copy(TireParameters.cCompetitionRear, w.c, w.c.Length);
		}		
		else if (tires=="supersport_front"){
			System.Array.Copy(TireParameters.aSuperSportFront, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bSuperSportFront, w.b, w.b.Length);
			if (TireParameters.cSuperSportFront.Length!=0) System.Array.Copy(TireParameters.cSuperSportFront, w.c, w.c.Length);
		}
		else if (tires=="supersport_rear"){
			System.Array.Copy(TireParameters.aSuperSportRear, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bSuperSportRear, w.b, w.b.Length);
			if (TireParameters.cSuperSportRear.Length!=0) System.Array.Copy(TireParameters.cSuperSportRear, w.c, w.c.Length);
		}		
		
		else if (tires=="sport_front"){
			System.Array.Copy(TireParameters.aSportFront, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bSportFront, w.b, w.b.Length);
			if (TireParameters.cSportFront.Length!=0) System.Array.Copy(TireParameters.cSportFront, w.c, w.c.Length);
		}
		else if (tires=="sport_rear"){
			System.Array.Copy(TireParameters.aSportRear, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bSportRear, w.b, w.b.Length);
			if (TireParameters.cSportRear.Length!=0) System.Array.Copy(TireParameters.cSportRear, w.c, w.c.Length);
		}
		else if (tires=="touring_front"){
			System.Array.Copy(TireParameters.aTouringFront, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bTouringFront, w.b, w.b.Length);
			if (TireParameters.cTouringFront.Length!=0) System.Array.Copy(TireParameters.cTouringFront, w.c, w.c.Length);
		}
		else if (tires=="touring_rear"){
			System.Array.Copy(TireParameters.aTouringRear, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bTouringRear, w.b, w.b.Length);
			if (TireParameters.cTouringRear.Length!=0) System.Array.Copy(TireParameters.cTouringRear, w.c, w.c.Length);
		}		
		else if (tires=="offroad_front"){	//OffRoad tires
			System.Array.Copy(TireParameters.aOffRoadFront, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bOffRoadFront, w.b, w.b.Length);
			if (TireParameters.cOffRoadFront.Length!=0) System.Array.Copy(TireParameters.cOffRoadFront, w.c, w.c.Length);
		}
		else if (tires=="offroad_rear"){	//OffRoad tires
			System.Array.Copy(TireParameters.aOffRoadRear, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bOffRoadRear, w.b, w.b.Length);
			if (TireParameters.cOffRoadRear.Length!=0) System.Array.Copy(TireParameters.cOffRoadRear, w.c, w.c.Length);
		}
		else if (tires=="truck_front"){	//Truck truck tires
			System.Array.Copy(TireParameters.aTruckFront, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bTruckFront, w.b, w.b.Length);
			if (TireParameters.cTruckFront.Length!=0) System.Array.Copy(TireParameters.cTruckFront, w.c, w.c.Length);
		}
		else if (tires=="truck_rear"){	//Truck truck tires
			System.Array.Copy(TireParameters.aTruckRear, w.a, w.a.Length);
			System.Array.Copy(TireParameters.bTruckRear, w.b, w.b.Length);
			if (TireParameters.cTruckRear.Length!=0) System.Array.Copy(TireParameters.cTruckRear, w.c, w.c.Length);
		}
		else{
			tiresFound=false;
		}
		w.CalculateIdealSlipRatioIdealSlipAngle(20);
	}