示例#1
0
		public void initFromLibrary(DriverLibraryRecord aLibraryRecord) {
			record = aLibraryRecord;
  
			GTDriver.allDrivers.Add((GTDriver) this);
			this.id = aLibraryRecord.id;
			this.aggressivenessOnBrake = aLibraryRecord.aggressivenessOnBrake;
			this.agressiveMultiplier = aLibraryRecord.agressiveMultiplier;
			this.backCollDist = aLibraryRecord.backCollDist;
			this.backToLineIncrement = aLibraryRecord.backToLineIncrement;
			this.collisionSideFactor = aLibraryRecord.collisionSideFactor;
			this.corneringSpeedFactor = aLibraryRecord.corneringSpeedFactor;
			this.driftingThrottleFactor = aLibraryRecord.driftingThrottleFactor;
			this.name = aLibraryRecord.driverName;
			this.frontCollDist = aLibraryRecord.frontCollDist;
			this.fuelLoadPercentage = aLibraryRecord.fuelLoadPercentage;
			this.fullAccelMargin = aLibraryRecord.fullAccelMargin;
			this.heightMargin = aLibraryRecord.heightMargin;
			this.humanError = aLibraryRecord.humanError;
			this.jumpThrottleMultiplier = aLibraryRecord.jumpThrottleMultiplier;
			this.jumpThrottleTime = aLibraryRecord.jumpThrottleTime;
			this.lengthMargin = aLibraryRecord.lengthMargin;
			this.lookAheadConstant = aLibraryRecord.lookAheadConstant;
			this.lookAheadFactor = aLibraryRecord.lookAheadFactor;
			this.maxDriftAngle = aLibraryRecord.maxDriftAngle;
			this.offtrackThrottleMultiplier = aLibraryRecord.offtrackThrottleMultiplier;
			this.overtakeFactor = aLibraryRecord.overtakeFactor;
			this.overtakeOffsetIncrementMax = aLibraryRecord.overtakeOffsetIncrementMax;
			this.overtakeOffsetIncrementMin = aLibraryRecord.overtakeOffsetIncrementMin;
			this.overtakeSpeedDifference = aLibraryRecord.overtakeSpeedDifference;
			this.shiftFactor = aLibraryRecord.shiftFactor;
			this.shiftUpFactor = aLibraryRecord.shiftUpFactor;
			this.SIDE_MARGIN = aLibraryRecord.SIDE_MARGIN;
			this.sideAvoidingFactor = aLibraryRecord.sideAvoidingFactor;
			this.sideMargin = aLibraryRecord.sideMargin;
			this.speedSteeringFactor = aLibraryRecord.speedSteeringFactor;
			this.steeringDriftFactor = aLibraryRecord.steeringDriftFactor;
			this.tyreChangePercentage = aLibraryRecord.tyreChangePercentage;

			this.sponsorFriendliness = aLibraryRecord.sponsorAppeal;

			this.demandingReputation = aLibraryRecord.demandsReputation;
		}
示例#2
0
		public virtual void FromString(string aString) {
			string[] all = Base64.Base64Decode(aString).Split(new char[] {'|'});
			id = Convert.ToInt32(all[0]);
			name = all[1];
			stamina = Convert.ToInt32(all[2]);
			this.aggressivenessOnBrake = (float) Convert.ToDouble(all[3]);
			this.speedSteeringFactor = (float) Convert.ToDouble(all[4]);
			this.lookAheadFactor = (float) Convert.ToDouble(all[5]);

			this.lookAheadConstant = (float) Convert.ToDouble(all[6]);
			this.corneringSpeedFactor = (float) Convert.ToDouble(all[7]);
			this.maxDriftAngle = (float) Convert.ToDouble(all[8]);
			driftingThrottleFactor = (float) Convert.ToDouble(all[9]);
			steeringDriftFactor = (float) Convert.ToDouble(all[10]);
			this.sideAvoidingFactor = (float) Convert.ToDouble(all[11]);
			this.collisionSideFactor = (float) Convert.ToDouble(all[12]);
			this.overtakeFactor = (float) Convert.ToDouble(all[13]);
			this.humanError = (float) Convert.ToDouble (all[14]);
			this.overtakeSpeedDifference = (float) Convert.ToDouble(all[15]);
			this.overtakeOffsetIncrementMin = (float) Convert.ToDouble(all[16]);
			this.overtakeOffsetIncrementMax = (float) Convert.ToDouble(all[17]);
			this.backToLineIncrement = (float) Convert.ToDouble(all[18]);
			this.shiftFactor = (float) Convert.ToDouble(all[19]);
			this.shiftUpFactor = (float) Convert.ToDouble(all[20]);
			this.tyreChangePercentage = (float) Convert.ToDouble(all[21]);
			this.fuelLoadPercentage = (float) Convert.ToDouble (all[22]);
			this.fullAccelMargin = (float) Convert.ToDouble(all[23]);
			this.frontCollDist = (float) Convert.ToDouble(all[24]);
			this.backCollDist = (float) Convert.ToDouble(all[25]);
			this.sideMargin = (float) Convert.ToDouble(all[26]);
			this.heightMargin = (float) Convert.ToDouble(all[27]);
			this.lengthMargin = (float) Convert.ToDouble(all[28]);
			this.SIDE_MARGIN = (float) Convert.ToDouble(all[29]);
			this.offtrackThrottleMultiplier = (float) Convert.ToDouble(all[30]);
			this.jumpThrottleMultiplier = (float) Convert.ToDouble(all[31]);
			this.jumpThrottleTime = (float) Convert.ToDouble(all[32]);
			this.agressiveMultiplier = (float) Convert.ToDouble(all[33]);
			this.sponsorFriendliness = (float) Convert.ToDouble(all[34]);
			this.demandingReputation = Convert.ToInt32(all[35]);
			this.positionDemanded = Convert.ToInt32(all[36]);


			for(int i = 0;i<DriverLibrary.REF.drivers.Count;i++) {
				if(DriverLibrary.REF.drivers[i].id==this.id) {
					this.record = DriverLibrary.REF.drivers[i];
				}
			}
			
			GTDriver.allDrivers.Add((GTDriver) this);
			if(GTDriver.allDrivers.Count>39) {
				Debug.LogError("Too many drivers");
			}
		}