Skip to content

Commit 7eca69b

Browse files
committed
Automatic merge of T1.5.1-1004-g6fd841761e and 25 pull requests
- Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 8f695a4: Blueprint/train car operations UI window - Pull request #885 at 2728d6d: feat: Add notifications to Menu - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #900 at c27f32d: DMI updates - Pull request #903 at 3e390b8: Downloading route content (Github, zip) - Pull request #912 at 359cfee: New Triple Valve Features Vol. 2 - Pull request #922 at a3bc9e7: Autopilot for timetable mode - Pull request #946 at 91a03af: Advanced track sounds - Pull request #949 at da7663b: Oil Burning Locomotive - Pull request #952 at 8347095: Investigation - Pulsing graphics - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at 84c2f4b: Add Support for Multiple Track Profiles - Pull request #956 at 406cba6: Map settings saved - Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value - Pull request #960 at c8e2a28: Fix draw state name in scripts - Pull request #962 at 46d0472: Fix pantographs on unpowered cars - Pull request #963 at 2d5a67d: Fix dynamic brake force indicator - Pull request #964 at b11c894: fix: Warning CA1417: Do not use the 'OutAttribute' for string parameter - Pull request #965 at 7554f02: style: Renormalize line endings - Pull request #966 at 6353e03: fix: Warning CS0618: 'string.Copy(string)' is obsolete
27 parents 4400a01 + 6fd8417 + dfc715e + d00beb9 + f92de76 + 8f695a4 + 2728d6d + 9a1d6b2 + 1f5ba4c + 5866028 + c27f32d + 3e390b8 + 359cfee + a3bc9e7 + 91a03af + da7663b + 8347095 + a519452 + 84c2f4b + 406cba6 + 2452cb0 + c8e2a28 + 46d0472 + 2d5a67d + b11c894 + 7554f02 + 6353e03 commit 7eca69b

File tree

25 files changed

+135
-135
lines changed

25 files changed

+135
-135
lines changed

Source/ORTS.Menu/ORTimetables.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ protected TimetableInfo(string filePath)
4848
try
4949
{
5050
ORTTList.Add(new TimetableFileLite(filePath));
51-
Description = String.Copy(ORTTList[0].Description);
52-
fileName = String.Copy(filePath);
51+
Description = ORTTList[0].Description;
52+
fileName = filePath;
5353
}
5454
catch
5555
{
@@ -70,8 +70,8 @@ protected TimetableInfo(String filePath, String directory)
7070
{
7171
TimetableGroupFileLite multiInfo = new TimetableGroupFileLite(filePath, directory);
7272
ORTTList = multiInfo.ORTTInfo;
73-
Description = String.Copy(multiInfo.Description);
74-
fileName = String.Copy(filePath);
73+
Description = multiInfo.Description;
74+
fileName = filePath;
7575
}
7676
catch
7777
{

Source/Orts.Formats.Msts/SignalConfigurationFile.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ static IDictionary<string, SignalDrawState> ReadDrawStates(STFReader stf)
750750
SignalDrawState drawState = new SignalDrawState(stf);
751751
if (drawStates.ContainsKey(drawState.Name))
752752
{
753-
string TempNew = String.Copy("DST");
753+
string TempNew = "DST";
754754
TempNew = String.Concat(TempNew,drawStates.Count.ToString());
755755
drawStates.Add(TempNew, drawState);
756756
STFException.TraceInformation(stf, "Duplicate SignalDrawState name \'"+drawState.Name+"\', using name \'"+TempNew+"\' instead");
@@ -956,7 +956,7 @@ public class SignalDrawState
956956
public SignalDrawState(string reqName, int reqIndex)
957957
{
958958
Index = reqIndex;
959-
Name = String.Copy(reqName);
959+
Name = reqName;
960960
DrawLights = null;
961961
}
962962

@@ -1065,7 +1065,7 @@ public class SignalAspect
10651065
public SignalAspect(MstsSignalAspect reqAspect, string reqName)
10661066
{
10671067
Aspect = reqAspect;
1068-
DrawStateName = String.Copy(reqName);
1068+
DrawStateName = reqName;
10691069
SpeedMpS = -1;
10701070
Asap = false;
10711071
NoSpeedReduction = false;

Source/Orts.Formats.Msts/SignalScripts.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public class scrReadInfo
5353

5454
public scrReadInfo(string thisString, int thisInt, string thisScript)
5555
{
56-
Readline = String.Copy(thisString);
56+
Readline = thisString;
5757
Linenumber = thisInt;
58-
Scriptname = String.Copy(thisScript);
58+
Scriptname = thisScript;
5959
}
6060
}// class scrReadInfo
6161

@@ -390,7 +390,7 @@ public void sigscrRead(string scrFileName, StreamReader scrStream, IDictionary<s
390390

391391
else
392392
{
393-
readInfo.Scriptname = String.Copy(scriptname);
393+
readInfo.Scriptname = scriptname;
394394
ScriptLines.Add(readInfo);
395395

396396
if (readInfo.Linenumber % 1000 == 1)
@@ -716,7 +716,7 @@ public static scrReadInfo scrReadLine(StreamReader scrStream, int lastline)
716716
}
717717
else
718718
{
719-
readLine = String.Copy(keepLine);
719+
readLine = keepLine;
720720
keepLine = String.Empty;
721721
#if DEBUG_PRINT_IN
722722
File.AppendAllText(din_fileLoc + @"sigfile.txt", "From store : " + readLine + "\n");
@@ -1506,7 +1506,7 @@ public static int FindEndCondition(List<scrReadInfo> FECScriptLines, int index)
15061506
Trace.TraceWarning("sigscr-file line {1} : Missing ) in IF statement ; starting with {0}",
15071507
presentstring, thisinfo.Linenumber.ToString());
15081508

1509-
string reportString = String.Copy(presentstring);
1509+
string reportString = presentstring;
15101510
if (possibleEnd > 0)
15111511
{
15121512
reportString = presentstring.Substring(0, possibleEnd);
@@ -2175,7 +2175,7 @@ public void SCRProcess_TermPartLine(string TermLinePart, ref int sublevel, int i
21752175
IDictionary<string, uint> LocalFloats, IDictionary<string, SignalFunction> signalFunctions, IList<string> ORNormalSubtypes, int linenumber)
21762176
{
21772177

2178-
string keepString = String.Copy(TermLinePart);
2178+
string keepString = TermLinePart;
21792179
string procString;
21802180
string operString;
21812181
bool syntaxerror = false;
@@ -2288,7 +2288,7 @@ public void SCRProcess_TermPartLine(string TermLinePart, ref int sublevel, int i
22882288
}
22892289
else
22902290
{
2291-
procString = String.Copy(keepString);
2291+
procString = keepString;
22922292
keepString = String.Empty;
22932293
}
22942294

Source/Orts.Formats.Msts/TrackDatabaseFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ public PlatformItem(SidingItem thisSiding)
14511451
ItemName = thisSiding.ItemName;
14521452
Flags1 = thisSiding.Flags1;
14531453
LinkedPlatformItemId = thisSiding.LinkedSidingId;
1454-
Station = String.Copy(ItemName);
1454+
Station = ItemName;
14551455
}
14561456
}
14571457

Source/Orts.Formats.OR/AESignals.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,7 @@ public AESignalWorldObject(SignalObj SignalWorldItem, SignalConfigurationFile si
20212021

20222022
public AESignalWorldObject(AESignalWorldObject copy)
20232023
{
2024-
SFileName = String.Copy(copy.SFileName);
2024+
SFileName = copy.SFileName;
20252025
Backfacing = copy.Backfacing;
20262026

20272027
HeadsSet = new bool[copy.HeadsSet.Length];

Source/Orts.Formats.OR/TimetableFile.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public void TTFilePreliminaryRead(String filePath, StreamReader scrStream, Strin
118118
// process comment row - cell at first comment row and column is description
119119
// process path and consist row
120120

121-
Description = String.Copy(filePath);
121+
Description = filePath;
122122

123123
bool descFound = false;
124124
bool pathFound = false;
@@ -136,7 +136,7 @@ public void TTFilePreliminaryRead(String filePath, StreamReader scrStream, Strin
136136
{
137137
if (String.Compare(Parts[0], "#comment", true) == 0)
138138
{
139-
Description = String.Copy(Parts[firstCommentColumn]);
139+
Description = Parts[firstCommentColumn];
140140
descFound = true;
141141
}
142142
}
@@ -146,7 +146,7 @@ public void TTFilePreliminaryRead(String filePath, StreamReader scrStream, Strin
146146
{
147147
pathFound = true;
148148
foreach (TrainInformation train in Trains)
149-
train.Path = String.Copy(Parts[train.Column]);
149+
train.Path = Parts[train.Column];
150150
}
151151
}
152152
if (!consistFound)
@@ -156,7 +156,7 @@ public void TTFilePreliminaryRead(String filePath, StreamReader scrStream, Strin
156156
consistFound = true;
157157
foreach (TrainInformation train in Trains)
158158
{
159-
train.Consist = String.Copy(Parts[train.Column]);
159+
train.Consist = Parts[train.Column];
160160
train.LeadingConsist = ExtractConsist(train.Consist, out train.ReverseConsist);
161161
}
162162
}
@@ -167,7 +167,7 @@ public void TTFilePreliminaryRead(String filePath, StreamReader scrStream, Strin
167167
{
168168
startFound = true;
169169
foreach (TrainInformation train in Trains)
170-
train.StartTime = String.Copy(Parts[train.Column]);
170+
train.StartTime = Parts[train.Column];
171171
}
172172
}
173173
if (!briefingFound)
@@ -177,9 +177,9 @@ public void TTFilePreliminaryRead(String filePath, StreamReader scrStream, Strin
177177
briefingFound = true;
178178

179179
// Newlines "\n" cannot be emdedded in CSV files, so HTML breaks "<br>" are used instead.
180-
Briefing = String.Copy(Parts[1].Replace("<br>", "\n"));
180+
Briefing = Parts[1].Replace("<br>", "\n");
181181
foreach (TrainInformation train in Trains)
182-
train.Briefing = String.Copy(Parts[train.Column]).Replace("<br>", "\n");
182+
train.Briefing = Parts[train.Column].Replace("<br>", "\n");
183183
}
184184
}
185185

@@ -192,8 +192,8 @@ private string ExtractConsist(string consistDef, out bool reverse)
192192
{
193193
bool isReverse = false;
194194

195-
string reqString = String.Copy(consistDef);
196-
string consistProc = String.Copy(consistDef).Trim();
195+
string reqString = consistDef;
196+
string consistProc = consistDef.Trim();
197197

198198
if (consistProc.Substring(0, 1).Equals("<"))
199199
{
@@ -228,7 +228,7 @@ private string ExtractConsist(string consistDef, out bool reverse)
228228
}
229229
else
230230
{
231-
reqString = String.Copy(consistDef);
231+
reqString = consistDef;
232232

233233
int sepIndex = consistDef.IndexOf('$');
234234
if (sepIndex > 0)
@@ -272,7 +272,7 @@ public class TrainInformation : IComparable<TrainInformation>
272272
public TrainInformation(int column, string train)
273273
{
274274
Column = column;
275-
Train = string.Copy(train);
275+
Train = train;
276276
Consist = string.Empty;
277277
LeadingConsist = string.Empty;
278278
Path = string.Empty;

Source/Orts.Formats.OR/TimetableGroupFile.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public TimetableGroupFileLite(String filePath, String directory)
4141
using (StreamReader scrStream = new StreamReader(filePath, true))
4242
{
4343
MultiTTFilePreliminaryRead(filePath, directory, scrStream);
44-
if (String.IsNullOrEmpty(Description)) Description = String.Copy(filePath);
44+
if (String.IsNullOrEmpty(Description)) Description = filePath;
4545
}
4646
}
4747
catch (Exception)
@@ -57,7 +57,7 @@ public TimetableGroupFileLite(String filePath, String directory)
5757

5858
public TimetableGroupFileLite(TimetableFileLite SingleTTInfo)
5959
{
60-
Description = String.Copy(SingleTTInfo.Description);
60+
Description = SingleTTInfo.Description;
6161
ORTTInfo.Add(SingleTTInfo);
6262
}
6363

@@ -102,7 +102,7 @@ public TimetableGroupFile(String filePath, String directory)
102102
using (StreamReader scrStream = new StreamReader(filePath, true))
103103
{
104104
MultiTTFileRead(filePath, directory, scrStream);
105-
if (String.IsNullOrEmpty(Description)) Description = String.Copy(filePath);
105+
if (String.IsNullOrEmpty(Description)) Description = filePath;
106106
}
107107
}
108108
catch (Exception)

Source/Orts.Simulation/MultiPlayer/Message.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,7 +2756,7 @@ public override void HandleMsg()
27562756
}
27572757
if (tmpcars2.Count == 0) return;
27582758
train2.Cars = tmpcars2;
2759-
train2.Name = String.Concat(String.Copy(train.Name), Train.TotalNumber.ToString());
2759+
train2.Name = String.Concat(train.Name, Train.TotalNumber.ToString());
27602760
train2.LeadLocomotive = null;
27612761
train2.LeadNextLocomotive();
27622762
train2.CheckFreight();
@@ -2840,7 +2840,7 @@ public override void HandleMsg()
28402840
train2.TrainType = Train.TRAINTYPE.STATIC;
28412841
this.oldTrainNumber = train.Number;
28422842
train2.LastReportedSpeed = 1;
2843-
if (train2.Name.Length < 4) train2.Name = String.Concat("STATIC-", String.Copy(train2.Name));
2843+
if (train2.Name.Length < 4) train2.Name = String.Concat("STATIC-", train2.Name);
28442844
MPManager.Simulator.AI.aiListChanged = true;
28452845
MPManager.Instance().AddOrRemoveLocomotives(user, train, true);
28462846
MPManager.Instance().AddOrRemoveLocomotives(user, train2, true);

Source/Orts.Simulation/Simulation/AIs/AIPath.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public AIPath(AIPath otherPath)
161161
FirstNode.NextSidingNode = Nodes[otherPath.FirstNode.NextSidingNode.Index];
162162
}
163163

164-
pathName = String.Copy(otherPath.pathName);
164+
pathName = otherPath.pathName;
165165
}
166166

167167
/// <summary>

Source/Orts.Simulation/Simulation/AIs/AITrain.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public AITrain(Simulator simulator, Service_Definition sd, AI ai, AIPath path, f
160160
{
161161
RandomizeEfficiency(ref Efficiency);
162162
}
163-
Name = String.Copy(name);
163+
Name = name;
164164
TrafficService = trafficService;
165165
MaxVelocityA = maxVelocityA;
166166
// <CSComment> TODO: as Cars.Count is always = 0 at this point, activityClearingDistanceM is set to the short distance also for long trains
@@ -6165,15 +6165,15 @@ public virtual String[] AddMovementState(String[] stateString, bool metric)
61656165
break;
61666166
}
61676167

6168-
retString[7] = String.Copy(actString);
6168+
retString[7] = actString;
61696169
retString[8] = FormatStrings.FormatDistance(
61706170
nextActionInfo.ActivateDistanceM - PresentPosition[0].DistanceTravelledM, metric);
61716171

61726172
}
61736173

6174-
retString[4] = String.Copy(movString);
6175-
retString[5] = String.Copy(abString);
6176-
retString[11] = String.Copy(nameString);
6174+
retString[4] = movString;
6175+
retString[5] = abString;
6176+
retString[11] = nameString;
61776177

61786178
return retString;
61796179
}

0 commit comments

Comments
 (0)