16
16
// along with Open Rails. If not, see <http://www.gnu.org/licenses/>.
17
17
18
18
// This code processes the Timetable definition and converts it into playable train information
19
- //
20
19
21
20
using System ;
22
21
using System . Collections . Generic ;
@@ -32,7 +31,6 @@ namespace Orts.Simulation.Timetables
32
31
/// </summary>
33
32
public class TurntableInfo : PoolInfo
34
33
{
35
-
36
34
//================================================================================================//
37
35
/// <summary>
38
36
/// Constructor
@@ -42,7 +40,6 @@ public TurntableInfo(Simulator simulatorref) : base(simulatorref)
42
40
{
43
41
}
44
42
45
-
46
43
//================================================================================================//
47
44
/// <summary>
48
45
/// Read pool files
@@ -55,33 +52,33 @@ public Dictionary<string, TimetableTurntablePool> ProcessTurntables(string[] arg
55
52
Dictionary < string , TimetableTurntablePool > turntables = new Dictionary < string , TimetableTurntablePool > ( ) ;
56
53
List < string > filenames ;
57
54
58
- // get filenames to process
55
+ // Get filenames to process
59
56
filenames = GetTurntableFilenames ( arguments [ 0 ] ) ;
60
57
61
- // get file contents as strings
58
+ // Get file contents as strings
62
59
Trace . Write ( "\n " ) ;
63
60
foreach ( string filePath in filenames )
64
61
{
65
- // get contents as strings
62
+ // Get contents as strings
66
63
Trace . Write ( "Turntable File : " + filePath + "\n " ) ;
67
64
var turntableInfo = new TimetableReader ( filePath ) ;
68
65
69
- // read lines from input until 'Name' definition is found
66
+ // Read lines from input until 'Name' definition is found
70
67
int lineindex = 1 ;
71
68
while ( lineindex < turntableInfo . Strings . Count )
72
69
{
73
70
switch ( turntableInfo . Strings [ lineindex ] [ 0 ] . ToLower ( ) . Trim ( ) )
74
71
{
75
- // skip comment
72
+ // Skip comment
76
73
case "#comment" :
77
74
lineindex ++ ;
78
75
break ;
79
76
80
- // process name
81
- // do not increase lineindex as that is done in called method
77
+ // Process name
78
+ // Do not increase lineindex as that is done in called method
82
79
case "#name" :
83
80
TimetableTurntablePool newTurntable = new TimetableTurntablePool ( turntableInfo , ref lineindex , simulator ) ;
84
- // store if valid pool
81
+ // Store if valid pool
85
82
if ( ! String . IsNullOrEmpty ( newTurntable . PoolName ) )
86
83
{
87
84
if ( turntables . ContainsKey ( newTurntable . PoolName ) )
@@ -107,7 +104,7 @@ public Dictionary<string, TimetableTurntablePool> ProcessTurntables(string[] arg
107
104
}
108
105
}
109
106
110
- return ( turntables ) ;
107
+ return turntables ;
111
108
}
112
109
113
110
@@ -121,7 +118,7 @@ private List<string> GetTurntableFilenames(string filePath)
121
118
{
122
119
List < string > filenames = new List < string > ( ) ;
123
120
124
- // check type of timetable file - list or single
121
+ // Check type of timetable file - list or single
125
122
string fileDirectory = Path . GetDirectoryName ( filePath ) ;
126
123
127
124
foreach ( var ORTurntableFile in Directory . GetFiles ( fileDirectory , "*.turntable_or" ) )
@@ -133,7 +130,7 @@ private List<string> GetTurntableFilenames(string filePath)
133
130
filenames . Add ( ORTunrtableFile ) ;
134
131
}
135
132
136
- return ( filenames ) ;
133
+ return filenames ;
137
134
}
138
135
}
139
136
}
0 commit comments