C# Класс OpenBve.TrainManager

Показать файл Открыть проект Примеры использования класса

Приватные методы

Метод Описание
ApplyAirBrakeHandle ( Train Train, AirBrakeHandleState State ) : void

Moves the air brake handle to the specified state

ApplyAirBrakeHandle ( Train Train, int RelativeDirection ) : void

Moves the air brake handle

ApplyEmergencyBrake ( Train Train ) : void

Applies the emergency brake

ApplyHoldBrake ( Train Train, bool Value ) : void

Applies or releases the hold brake

ApplyNotch ( Train Train, int PowerValue, bool PowerRelative, int BrakeValue, bool BrakeRelative ) : void
ApplyReverser ( Train Train, int Value, bool Relative ) : void

Applies a reverser notch

ChangeCarSection ( Train Train, int CarIndex, int SectionIndex ) : void
ChangeFrontBogieSection ( Train Train, int CarIndex, int SectionIndex ) : void
ChangeRearBogieSection ( Train Train, int CarIndex, int SectionIndex ) : void
CloseTrainDoors ( Train Train, bool Left, bool Right ) : void

Closes the left-hand or right-hand doors for the specified train

CreateWorldCoordinates ( Train Train, int CarIndex, double relx, double rely, double relz, double &posx, double &posy, double &posz, double &dirx, double &diry, double &dirz ) : void
DisposeTrain ( Train Train ) : void
GetAccelerationOutput ( Train Train, int CarIndex, int CurveIndex, double Speed ) : double
GetCriticalWheelSlipAccelerationForElectricMotor ( Train Train, int CarIndex, double AdhesionMultiplier, double UpY, double Speed ) : double
GetCriticalWheelSlipAccelerationForFrictionBrake ( Train Train, int CarIndex, double AdhesionMultiplier, double UpY, double Speed ) : double
GetDoorsState ( Train Train, bool Left, bool Right ) : TrainDoorState

Returns the combination of door states encountered in a train.

GetRate ( double Ratio, double Factor ) : double
GetResistance ( Train Train, int CarIndex, Axle &Axle, double Speed ) : double
InitializeCar ( Train Train, int CarIndex ) : void
InitializeCarSection ( Train Train, int CarIndex, int SectionIndex ) : void
InitializeCarSectionElement ( Train Train, int CarIndex, int SectionIndex, int ElementIndex, int StateIndex ) : void
InitializeFrontBogieSection ( Train Train, int CarIndex, int SectionIndex ) : void
InitializeFrontBogieSectionElement ( Train Train, int CarIndex, int SectionIndex, int ElementIndex, int StateIndex ) : void
InitializeRearBogieSection ( Train Train, int CarIndex, int SectionIndex ) : void
InitializeRearBogieSectionElement ( Train Train, int CarIndex, int SectionIndex, int ElementIndex, int StateIndex ) : void
InitializeTrain ( Train Train ) : void
JumpTrain ( Train train, int stationIndex ) : void

Jumps a train to a new station

MoveCar ( Train Train, int CarIndex, double Delta, double TimeElapsed ) : void
OpenTrainDoors ( Train Train, bool Left, bool Right ) : void

Opens the left-hand or right-hand doors for the specified train

ParsePanelConfig ( string TrainPath, System Encoding, TrainManager Train ) : void

Attempts to load and parse the current train's panel configuration file.

SynchronizeTrain ( Train Train ) : void
UnapplyEmergencyBrake ( Train Train ) : void

Releases the emergency brake

UnderailTrain ( Train Train ) : void

Un-derails a train

UnderailTrains ( ) : void

Un-derails all trains within the simulation

UpdateAtmosphericConstants ( Train Train ) : void
UpdateBogieTopplingCantAndSpring ( Train Train, int CarIndex, double TimeElapsed ) : void
UpdateBrakeSystem ( Train Train, double TimeElapsed, double &DecelerationDueToBrake, double &DecelerationDueToMotor ) : void

Updates the brake system for a complete train

UpdateBrakeSystem ( Train Train, int CarIndex, double TimeElapsed, double &DecelerationDueToBrake, double &DecelerationDueToMotor ) : void

Updates the brake system for a car within a train

UpdateCamera ( Train Train, int Car ) : void
UpdateCarSectionElement ( Train Train, int CarIndex, int SectionIndex, int ElementIndex, System.Vector3 Position, System.Vector3 Direction, System.Vector3 Up, System.Vector3 Side, bool Show, double TimeElapsed, bool ForceUpdate ) : void
UpdateFrontBogieObjects ( Train Train, int CarIndex, double TimeElapsed, bool ForceUpdate ) : void
UpdateFrontBogieSectionElement ( Train Train, int CarIndex, int SectionIndex, int ElementIndex, System.Vector3 Position, System.Vector3 Direction, System.Vector3 Up, System.Vector3 Side, bool Show, double TimeElapsed, bool ForceUpdate ) : void
UpdateRearBogieObjects ( Train Train, int CarIndex, double TimeElapsed, bool ForceUpdate ) : void
UpdateRearBogieSectionElement ( Train Train, int CarIndex, int SectionIndex, int ElementIndex, System.Vector3 Position, System.Vector3 Direction, System.Vector3 Up, System.Vector3 Side, bool Show, double TimeElapsed, bool ForceUpdate ) : void
UpdateSafetySystem ( Train Train ) : void
UpdateSpeeds ( Train Train, double TimeElapsed ) : void
UpdateTopplingCantAndSpring ( Train Train, int CarIndex, double TimeElapsed ) : void
UpdateTrain ( Train Train, double TimeElapsed ) : void
UpdateTrainDoors ( Train Train, double TimeElapsed ) : void

Is called once a frame, to update the door states of the specified train

UpdateTrainMassFromPassengerRatio ( Train Train ) : void

Called after passengers have finished boarding, in order to update the train's mass from the new passenger ratio

UpdateTrainObjects ( Train Train, double TimeElapsed, bool ForceUpdate ) : void
UpdateTrainObjects ( Train Train, int CarIndex, double TimeElapsed, bool ForceUpdate ) : void
UpdateTrainObjects ( double TimeElapsed, bool ForceUpdate ) : void
UpdateTrainPassengers ( Train Train, double TimeElapsed ) : void

Called once a frame to update the passengers of the given train

UpdateTrainPhysicsAndControls ( Train Train, double TimeElapsed ) : void
UpdateTrains ( double TimeElapsed ) : void

This method should be called once a frame to update the position, speed and state of all trains within the simulation