C# Class OpenBve.Scripting.Train

Provides scripting access to trains internal variables
Mostra file Open project: leezer3/OpenBVE

Public Methods

Method Description
acceleration ( TrainManager Train, int CarIndex ) : double

Returns the acceleration of the selected car

accelerationMotor ( TrainManager Train ) : double

Returns the acceleration that the first motor car is currently generating in m/s

accelerationMotor ( TrainManager Train, int CarIndex ) : double

Returns the acceleration that the selected car's motor is currently generating in m/s

brakeCylinder ( TrainManager Train, int CarIndex ) : double

Returns the brake cylinder pressure of the selected car of the selected train

brakeNotch ( TrainManager Train ) : int

Returns the driver's selected brake notch for the selected train

brakeNotchLinear ( TrainManager Train ) : int

Returns the driver's selected brake notch (Including EB) for the selected train

brakeNotches ( TrainManager Train ) : int

Returns the maximum brake notch for the selected train

brakeNotchesLinear ( TrainManager Train ) : int

Returns the maximum possible brake notch (Including EB) for the selected train

brakePipe ( TrainManager Train, int CarIndex ) : double

Returns the brake pipe pressure of the selected car of the selected train

constantSpeed ( TrainManager Train ) : bool

Whether the constant speed devicee is currently active for the selected train

distance ( TrainManager Train, Vector3 Position ) : double

Returns the cartesian distance to the nearest car of the selected train

distance ( TrainManager Train, int CarIndex, Vector3 Position ) : double

Returns the cartesian distance to the selected car of the selected train

doors ( TrainManager Train ) : double

Returns the doors state of the selected train

doors ( TrainManager Train, int CarIndex ) : double

Returns the doors state of the selected car of the selected train

emergencyBrake ( TrainManager Train ) : bool

Returns whether EB is active for the selected train

hasAirBrake ( TrainManager Train ) : bool

Whether the selected train has an automatic air brake

hasConstantSpeed ( TrainManager Train ) : bool

Whether the selected train has a constant speed device

hasHoldBrake ( TrainManager Train ) : bool

Whether the selected train has a hold brake

hasPlugin ( TrainManager Train ) : bool

Whether the selected train uses a custom plugin

holdBrake ( TrainManager Train ) : bool

Whether the hold brake is currently active for the selected train

leftDoors ( TrainManager Train ) : double

Returns the left-hand doors state of the selected train

leftDoors ( TrainManager Train, int CarIndex ) : double

Returns the left-hand doors state of the selected car of the selected train

leftDoorsTarget ( TrainManager Train ) : bool

Returns whether the left doors are opening for the selected train

leftDoorsTarget ( TrainManager Train, int CarIndex ) : bool

Returns whether the left doors are opening for the selected car of the selected train

mainReservoir ( TrainManager Train, int CarIndex ) : double

Returns the main brake reservoir pressure of the selected car of the selected train

numberOfCars ( TrainManager Train ) : int

Returns the number of cars in this train

pluginState ( TrainManager Train, int pluginState ) : int

Whether the selected train has a hold brake

powerNotch ( TrainManager Train ) : int

Returns the driver's selected power notch for the selected train

powerNotches ( TrainManager Train ) : int

Returns the maximum power notch for the selected train

reverserNotch ( TrainManager Train ) : int

Returns the driver's selected reverser position for the selected train

rightDoors ( TrainManager Train ) : double

Returns the left-hand doors state of the selected train

rightDoors ( TrainManager Train, int CarIndex ) : double

Returns the left-hand doors state of the selected car of the selected train

rightDoorsTarget ( TrainManager Train ) : bool

Returns whether the left doors are opening for the selected train

rightDoorsTarget ( TrainManager Train, int CarIndex ) : bool

Returns whether the left doors are opening for the selected car of the selected train

speed ( TrainManager Train, int CarIndex ) : double

Returns the speed of the selected car

speedometer ( TrainManager Train, int CarIndex ) : double

Returns the speed of the selected car, accounting for wheelslip and wheel lock

straightAirPipe ( TrainManager Train, int CarIndex ) : double

Returns the brake pipe pressure of the selected car of the selected train

trackDistance ( TrainManager Train, double TrackPosition ) : double

Returns the track distance to the nearest car of the selected train

trackDistance ( TrainManager Train, int CarIndex, double TrackPosition ) : double

Returns the track distance to the nearest car of the selected train

Method Details

acceleration() public static method

Returns the acceleration of the selected car
public static acceleration ( TrainManager Train, int CarIndex ) : double
Train TrainManager The selected train
CarIndex int The car for which to get the acceleration
return double

accelerationMotor() public static method

Returns the acceleration that the first motor car is currently generating in m/s
public static accelerationMotor ( TrainManager Train ) : double
Train TrainManager The selected train
return double

accelerationMotor() public static method

Returns the acceleration that the selected car's motor is currently generating in m/s
public static accelerationMotor ( TrainManager Train, int CarIndex ) : double
Train TrainManager The selected train
CarIndex int The selected car
return double

brakeCylinder() public static method

Returns the brake cylinder pressure of the selected car of the selected train
public static brakeCylinder ( TrainManager Train, int CarIndex ) : double
Train TrainManager The selected train
CarIndex int The selected car
return double

brakeNotch() public static method

Returns the driver's selected brake notch for the selected train
public static brakeNotch ( TrainManager Train ) : int
Train TrainManager The selected train
return int

brakeNotchLinear() public static method

Returns the driver's selected brake notch (Including EB) for the selected train
public static brakeNotchLinear ( TrainManager Train ) : int
Train TrainManager The selected train
return int

brakeNotches() public static method

Returns the maximum brake notch for the selected train
public static brakeNotches ( TrainManager Train ) : int
Train TrainManager The selected train
return int

brakeNotchesLinear() public static method

Returns the maximum possible brake notch (Including EB) for the selected train
public static brakeNotchesLinear ( TrainManager Train ) : int
Train TrainManager The selected train
return int

brakePipe() public static method

Returns the brake pipe pressure of the selected car of the selected train
public static brakePipe ( TrainManager Train, int CarIndex ) : double
Train TrainManager The selected train
CarIndex int The selected car
return double

constantSpeed() public static method

Whether the constant speed devicee is currently active for the selected train
public static constantSpeed ( TrainManager Train ) : bool
Train TrainManager The selected train
return bool

distance() public static method

Returns the cartesian distance to the nearest car of the selected train
public static distance ( TrainManager Train, Vector3 Position ) : double
Train TrainManager The selected train
Position Vector3 The object's absolute in-game position
return double

distance() public static method

Returns the cartesian distance to the selected car of the selected train
public static distance ( TrainManager Train, int CarIndex, Vector3 Position ) : double
Train TrainManager The selected train
CarIndex int The selected car
Position Vector3 The object's absolute in-game position
return double

doors() public static method

Returns the doors state of the selected train
public static doors ( TrainManager Train ) : double
Train TrainManager The selected train
return double

doors() public static method

Returns the doors state of the selected car of the selected train
public static doors ( TrainManager Train, int CarIndex ) : double
Train TrainManager The selected train
CarIndex int The selected car
return double

emergencyBrake() public static method

Returns whether EB is active for the selected train
public static emergencyBrake ( TrainManager Train ) : bool
Train TrainManager The selected train
return bool

hasAirBrake() public static method

Whether the selected train has an automatic air brake
public static hasAirBrake ( TrainManager Train ) : bool
Train TrainManager The selected train
return bool

hasConstantSpeed() public static method

Whether the selected train has a constant speed device
public static hasConstantSpeed ( TrainManager Train ) : bool
Train TrainManager The selected train
return bool

hasHoldBrake() public static method

Whether the selected train has a hold brake
public static hasHoldBrake ( TrainManager Train ) : bool
Train TrainManager The selected train
return bool

hasPlugin() public static method

Whether the selected train uses a custom plugin
public static hasPlugin ( TrainManager Train ) : bool
Train TrainManager The selected train
return bool

holdBrake() public static method

Whether the hold brake is currently active for the selected train
public static holdBrake ( TrainManager Train ) : bool
Train TrainManager The selected train
return bool

leftDoors() public static method

Returns the left-hand doors state of the selected train
public static leftDoors ( TrainManager Train ) : double
Train TrainManager The selected train
return double

leftDoors() public static method

Returns the left-hand doors state of the selected car of the selected train
public static leftDoors ( TrainManager Train, int CarIndex ) : double
Train TrainManager The selected train
CarIndex int The selected car
return double

leftDoorsTarget() public static method

Returns whether the left doors are opening for the selected train
public static leftDoorsTarget ( TrainManager Train ) : bool
Train TrainManager The selected train
return bool

leftDoorsTarget() public static method

Returns whether the left doors are opening for the selected car of the selected train
public static leftDoorsTarget ( TrainManager Train, int CarIndex ) : bool
Train TrainManager The selected train
CarIndex int The selected car
return bool

mainReservoir() public static method

Returns the main brake reservoir pressure of the selected car of the selected train
public static mainReservoir ( TrainManager Train, int CarIndex ) : double
Train TrainManager The selected train
CarIndex int The selected car
return double

numberOfCars() public static method

Returns the number of cars in this train
public static numberOfCars ( TrainManager Train ) : int
Train TrainManager The selected train
return int

pluginState() public static method

Whether the selected train has a hold brake
public static pluginState ( TrainManager Train, int pluginState ) : int
Train TrainManager The selected train
pluginState int The plugin state to query
return int

powerNotch() public static method

Returns the driver's selected power notch for the selected train
public static powerNotch ( TrainManager Train ) : int
Train TrainManager The selected train
return int

powerNotches() public static method

Returns the maximum power notch for the selected train
public static powerNotches ( TrainManager Train ) : int
Train TrainManager The selected train
return int

reverserNotch() public static method

Returns the driver's selected reverser position for the selected train
public static reverserNotch ( TrainManager Train ) : int
Train TrainManager The selected train
return int

rightDoors() public static method

Returns the left-hand doors state of the selected train
public static rightDoors ( TrainManager Train ) : double
Train TrainManager The selected train
return double

rightDoors() public static method

Returns the left-hand doors state of the selected car of the selected train
public static rightDoors ( TrainManager Train, int CarIndex ) : double
Train TrainManager The selected train
CarIndex int The selected car
return double

rightDoorsTarget() public static method

Returns whether the left doors are opening for the selected train
public static rightDoorsTarget ( TrainManager Train ) : bool
Train TrainManager The selected train
return bool

rightDoorsTarget() public static method

Returns whether the left doors are opening for the selected car of the selected train
public static rightDoorsTarget ( TrainManager Train, int CarIndex ) : bool
Train TrainManager The selected train
CarIndex int The selected car
return bool

speed() public static method

Returns the speed of the selected car
public static speed ( TrainManager Train, int CarIndex ) : double
Train TrainManager The selected train
CarIndex int The car for which to get the speed
return double

speedometer() public static method

Returns the speed of the selected car, accounting for wheelslip and wheel lock
public static speedometer ( TrainManager Train, int CarIndex ) : double
Train TrainManager The selected train
CarIndex int The car for which to get the speed
return double

straightAirPipe() public static method

Returns the brake pipe pressure of the selected car of the selected train
public static straightAirPipe ( TrainManager Train, int CarIndex ) : double
Train TrainManager The selected train
CarIndex int The selected car
return double

trackDistance() public static method

Returns the track distance to the nearest car of the selected train
public static trackDistance ( TrainManager Train, double TrackPosition ) : double
Train TrainManager The selected train
TrackPosition double The object's track position
return double

trackDistance() public static method

Returns the track distance to the nearest car of the selected train
public static trackDistance ( TrainManager Train, int CarIndex, double TrackPosition ) : double
Train TrainManager The selected train
CarIndex int The selected car
TrackPosition double The object's track position
return double