public override void ChangeGearDown() { if (DieselEngines[0].GearBox != null) { if (DieselEngines[0].GearBox.GearBoxOperation == GearBoxOperation.Semiautomatic) { DieselEngines[0].GearBox.AutoGearDown(); GearBoxController.SetValue((float)DieselEngines[0].GearBox.NextGearIndex); } } }
/// <summary> /// Restores the type of gearbox, that was forced to /// automatic for AI trains /// </summary> public override void SwitchToPlayerControl() { foreach (DieselEngine de in DieselEngines) { if (de.GearBox != null) { de.GearBox.GearBoxOperation = de.GearBox.OriginalGearBoxOperation; } } if (DieselEngines[0].GearBox != null && GearBoxController != null) { GearBoxController.CurrentNotch = DieselEngines[0].GearBox.CurrentGearIndex + 1; GearboxGearIndex = DieselEngines[0].GearBox.CurrentGearIndex + 1; GearBoxController.SetValue((float)GearBoxController.CurrentNotch); } }
//================================================================================================// /// <summary> /// Set starting conditions when initial speed > 0 /// public override void InitializeMoving() { base.InitializeMoving(); WheelSpeedMpS = SpeedMpS; DynamicBrakePercent = -1; if (DieselEngines[0].GearBox != null && GearBoxController != null) { DieselEngines[0].GearBox.InitializeMoving(); DieselEngines[0].InitializeMoving(); if (IsLeadLocomotive()) { Train.MUGearboxGearIndex = DieselEngines[0].GearBox.CurrentGearIndex + 1; Train.AITrainGearboxGearIndex = DieselEngines[0].GearBox.CurrentGearIndex + 1; } GearBoxController.CurrentNotch = Train.MUGearboxGearIndex; GearboxGearIndex = DieselEngines[0].GearBox.CurrentGearIndex + 1; GearBoxController.SetValue((float)GearBoxController.CurrentNotch); } ThrottleController.SetValue(Train.MUThrottlePercent / 100); }