Skip to content

Commit 13252f9

Browse files
committed
TurntableInfo.cs quality improvements
1 parent 09d19f6 commit 13252f9

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

Source/Orts.Simulation/Simulation/Timetables/TurntableInfo.cs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// along with Open Rails. If not, see <http://www.gnu.org/licenses/>.
1717

1818
// This code processes the Timetable definition and converts it into playable train information
19-
//
2019

2120
using System;
2221
using System.Collections.Generic;
@@ -32,7 +31,6 @@ namespace Orts.Simulation.Timetables
3231
/// </summary>
3332
public class TurntableInfo : PoolInfo
3433
{
35-
3634
//================================================================================================//
3735
/// <summary>
3836
/// Constructor
@@ -42,7 +40,6 @@ public TurntableInfo(Simulator simulatorref) : base(simulatorref)
4240
{
4341
}
4442

45-
4643
//================================================================================================//
4744
/// <summary>
4845
/// Read pool files
@@ -55,33 +52,33 @@ public Dictionary<string, TimetableTurntablePool> ProcessTurntables(string[] arg
5552
Dictionary<string, TimetableTurntablePool> turntables = new Dictionary<string, TimetableTurntablePool>();
5653
List<string> filenames;
5754

58-
// get filenames to process
55+
// Get filenames to process
5956
filenames = GetTurntableFilenames(arguments[0]);
6057

61-
// get file contents as strings
58+
// Get file contents as strings
6259
Trace.Write("\n");
6360
foreach (string filePath in filenames)
6461
{
65-
// get contents as strings
62+
// Get contents as strings
6663
Trace.Write("Turntable File : " + filePath + "\n");
6764
var turntableInfo = new TimetableReader(filePath);
6865

69-
// read lines from input until 'Name' definition is found
66+
// Read lines from input until 'Name' definition is found
7067
int lineindex = 1;
7168
while (lineindex < turntableInfo.Strings.Count)
7269
{
7370
switch (turntableInfo.Strings[lineindex][0].ToLower().Trim())
7471
{
75-
// skip comment
72+
// Skip comment
7673
case "#comment":
7774
lineindex++;
7875
break;
7976

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
8279
case "#name":
8380
TimetableTurntablePool newTurntable = new TimetableTurntablePool(turntableInfo, ref lineindex, simulator);
84-
// store if valid pool
81+
// Store if valid pool
8582
if (!String.IsNullOrEmpty(newTurntable.PoolName))
8683
{
8784
if (turntables.ContainsKey(newTurntable.PoolName))
@@ -107,7 +104,7 @@ public Dictionary<string, TimetableTurntablePool> ProcessTurntables(string[] arg
107104
}
108105
}
109106

110-
return (turntables);
107+
return turntables;
111108
}
112109

113110

@@ -121,7 +118,7 @@ private List<string> GetTurntableFilenames(string filePath)
121118
{
122119
List<string> filenames = new List<string>();
123120

124-
// check type of timetable file - list or single
121+
// Check type of timetable file - list or single
125122
string fileDirectory = Path.GetDirectoryName(filePath);
126123

127124
foreach (var ORTurntableFile in Directory.GetFiles(fileDirectory, "*.turntable_or"))
@@ -133,7 +130,7 @@ private List<string> GetTurntableFilenames(string filePath)
133130
filenames.Add(ORTunrtableFile);
134131
}
135132

136-
return (filenames);
133+
return filenames;
137134
}
138135
}
139136
}

0 commit comments

Comments
 (0)