Make properties read-only

This commit is contained in:
Marc Riera 2024-12-13 00:17:36 +01:00
parent 261c1fa9c1
commit 6bd560d93a
3 changed files with 7 additions and 7 deletions

View file

@ -58,25 +58,25 @@ namespace OpenbveFcmbTrainPlugin
private TrackStates TrackState; private TrackStates TrackState;
/// <summary>The time needed by the ATC device to initialize, in seconds.</summary> /// <summary>The time needed by the ATC device to initialize, in seconds.</summary>
private double InitializationTime; private readonly double InitializationTime;
/// <summary>A counter to keep track of initialization time, in seconds.</summary> /// <summary>A counter to keep track of initialization time, in seconds.</summary>
private double InitializationCounter; private double InitializationCounter;
/// <summary>The blinking time for lamps, in milliseconds.</summary> /// <summary>The blinking time for lamps, in milliseconds.</summary>
private double BlinkTime; private readonly double BlinkTime;
/// <summary>A counter to keep track of blink time, in milliseconds.</summary> /// <summary>A counter to keep track of blink time, in milliseconds.</summary>
private double BlinkCounter; private double BlinkCounter;
/// <summary>The time after which YARD mode enters idle state and engages the service brake, in seconds.</summary> /// <summary>The time after which YARD mode enters idle state and engages the service brake, in seconds.</summary>
private double YardIdleTime; private readonly double YardIdleTime;
/// <summary>A counter to keep track of YARD mode idle time, in seconds.</summary> /// <summary>A counter to keep track of YARD mode idle time, in seconds.</summary>
private double YardIdleCounter; private double YardIdleCounter;
/// <summary>The maximum speed in YARD mode, in km/h.</summary> /// <summary>The maximum speed in YARD mode, in km/h.</summary>
private double YardMaximumSpeed; private readonly double YardMaximumSpeed;
/// <summary>Represents an ATC movement permission order.</summary> /// <summary>Represents an ATC movement permission order.</summary>
private class MovementPermission private class MovementPermission

View file

@ -50,7 +50,7 @@ namespace OpenbveFcmbTrainPlugin
private TrackStates TrackState; private TrackStates TrackState;
/// <summary>The maximum speed in YARD mode, in km/h.</summary> /// <summary>The maximum speed in YARD mode, in km/h.</summary>
private double YardMaximumSpeed; private readonly double YardMaximumSpeed;
/// <summary>Represents an ATC speed code.</summary> /// <summary>Represents an ATC speed code.</summary>
private class SpeedCode private class SpeedCode

View file

@ -24,10 +24,10 @@ namespace OpenbveFcmbTrainPlugin
private double Counter; private double Counter;
/// <summary>The delay time until the service brake is applied, in seconds.</summary> /// <summary>The delay time until the service brake is applied, in seconds.</summary>
private double BrakeDelay = 5.0; private readonly double BrakeDelay = 5.0;
/// <summary>Whether the train must be completely stopped to release the brakes.</summary> /// <summary>Whether the train must be completely stopped to release the brakes.</summary>
private bool FullReset; private readonly bool FullReset;
/// <summary>Creates an instance of the Deadman device.</summary> /// <summary>Creates an instance of the Deadman device.</summary>
/// <param name="brakeDelay">The delay before the brakes are applied, in seconds.</param> /// <param name="brakeDelay">The delay before the brakes are applied, in seconds.</param>