Skip to content

Commit bc8aea4

Browse files
Changed the class methods to PascalCase and the method parameters to camelCase
1 parent 41c9f26 commit bc8aea4

File tree

4 files changed

+43
-47
lines changed

4 files changed

+43
-47
lines changed

Source/ORTS.Common/InfoApiMap.cs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public class InfoApiMap
5353
public float LonMin;
5454
public float LonMax;
5555

56-
public InfoApiMap(string PowerSupplyName)
56+
public InfoApiMap(string powerSupplyName)
5757
{
58-
initTypeOfLocomotive(PowerSupplyName);
58+
InitTypeOfLocomotive(powerSupplyName);
5959

6060
PointOnApiMapList = new LinkedList<PointOnApiMap>();
6161
LineOnApiMapList = new LinkedList<LineOnApiMap>();
@@ -66,9 +66,9 @@ public InfoApiMap(string PowerSupplyName)
6666
LonMin = +999999f;
6767
}
6868

69-
private void initTypeOfLocomotive(string PowerSupplyName)
69+
private void InitTypeOfLocomotive(string powerSupplyName)
7070
{
71-
string powerSupplyNameToLower = PowerSupplyName.ToLower();
71+
string powerSupplyNameToLower = powerSupplyName.ToLower();
7272
if (powerSupplyNameToLower.Contains("steam"))
7373
{
7474
TypeOfLocomotive = "steam";
@@ -86,38 +86,38 @@ private void initTypeOfLocomotive(string PowerSupplyName)
8686
}
8787
}
8888

89-
public static LatLon convertToLatLon(int TileX, int TileZ, float X, float Y, float Z)
89+
public static LatLon ConvertToLatLon(int tileX, int tileZ, float x, float y, float z)
9090
{
9191
double latitude = 1f;
9292
double longitude = 1f;
9393

94-
WorldLocation mstsLocation = new WorldLocation(TileX, TileZ, X, Y, Z);
95-
new WorldLatLon().ConvertWTC(TileX, TileZ, mstsLocation.Location, ref latitude, ref longitude);
94+
WorldLocation mstsLocation = new WorldLocation(tileX, tileZ, x, y, z);
95+
new WorldLatLon().ConvertWTC(tileX, tileZ, mstsLocation.Location, ref latitude, ref longitude);
9696
LatLon latLon = new LatLon(MathHelper.ToDegrees((float)latitude), MathHelper.ToDegrees((float)longitude));
9797

9898
return latLon;
9999
}
100100

101-
public void addToPointOnApiMap(
102-
int TileX, int TileZ, float X, float Y, float Z,
103-
string Color, TypeOfPointOnApiMap TypeOfPointOnApiMap, string Name)
101+
public void AddToPointOnApiMap(
102+
int tileX, int tileZ, float x, float y, float z,
103+
string Color, TypeOfPointOnApiMap typeOfPointOnApiMap, string name)
104104
{
105-
LatLon latLon = InfoApiMap.convertToLatLon(TileX, TileZ, X, Y, Z);
105+
LatLon latLon = InfoApiMap.ConvertToLatLon(tileX, tileZ, x, y, z);
106106

107-
addToPointOnApiMap(latLon,
108-
Color, TypeOfPointOnApiMap, Name);
107+
AddToPointOnApiMap(latLon,
108+
Color, typeOfPointOnApiMap, name);
109109
}
110110

111-
public void addToPointOnApiMap(
112-
LatLon LatLon,
113-
string Color, TypeOfPointOnApiMap TypeOfPointOnApiMap, string Name)
111+
public void AddToPointOnApiMap(
112+
LatLon latLon,
113+
string color, TypeOfPointOnApiMap typeOfPointOnApiMap, string name)
114114
{
115115
PointOnApiMap pointOnApiMap = new PointOnApiMap
116116
{
117-
LatLon = LatLon,
118-
Color = Color,
119-
TypeOfPointOnApiMap = TypeOfPointOnApiMap,
120-
Name = Name
117+
LatLon = latLon,
118+
Color = color,
119+
TypeOfPointOnApiMap = typeOfPointOnApiMap,
120+
Name = name
121121
};
122122

123123
if (pointOnApiMap.TypeOfPointOnApiMap == TypeOfPointOnApiMap.Named)
@@ -148,12 +148,12 @@ public void addToPointOnApiMap(
148148
}
149149
}
150150

151-
public void addToLineOnApiMap(LatLon LatLonFrom, LatLon LatLongTo)
151+
public void AddToLineOnApiMap(LatLon latLonFrom, LatLon latLongTo)
152152
{
153153
LineOnApiMap lineOnApiMap = new LineOnApiMap
154154
{
155-
LatLonFrom = LatLonFrom,
156-
LatLonTo = LatLongTo
155+
LatLonFrom = latLonFrom,
156+
LatLonTo = latLongTo
157157
};
158158
LineOnApiMapList.AddLast(lineOnApiMap);
159159
}

Source/ORTS.Common/WorldLatLon.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ public class LatLon
296296
public float Lat { get; }
297297
public float Lon { get; }
298298

299-
public LatLon(float Lat, float Lon)
299+
public LatLon(float lat, float lon)
300300
{
301-
this.Lat = Lat;
302-
this.Lon = Lon;
301+
this.Lat = lat;
302+
this.Lon = lon;
303303
}
304304
}
305305

@@ -311,10 +311,10 @@ public class LatLonDirection
311311
public LatLon LatLon { get; }
312312
public float DirectionDeg { get; }
313313

314-
public LatLonDirection(LatLon LatLon, float DirectionDeg)
314+
public LatLonDirection(LatLon latLon, float directionDeg)
315315
{
316-
this.LatLon = LatLon;
317-
this.DirectionDeg = DirectionDeg;
316+
this.LatLon = latLon;
317+
this.DirectionDeg = directionDeg;
318318
}
319319
}
320320
}

Source/Orts.Formats.Msts/TrackDatabaseFile.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public void AddTrItems(TrItem[] newTrItems)
194194
TrItemTable = newTrItemTable;
195195
}
196196

197-
public void AddTrNodesToPointsOnApiMap(InfoApiMap InfoApiMap)
197+
public void AddTrNodesToPointsOnApiMap(InfoApiMap infoApiMap)
198198
{
199199
foreach (TrackNode trackNode in TrackNodes)
200200
{
@@ -204,15 +204,15 @@ public void AddTrNodesToPointsOnApiMap(InfoApiMap InfoApiMap)
204204
{
205205
if (trackNode.UiD != null)
206206
{
207-
InfoApiMap.addToPointOnApiMap(
207+
infoApiMap.AddToPointOnApiMap(
208208
trackNode.UiD.TileX, trackNode.UiD.TileZ,
209209
trackNode.UiD.X, trackNode.UiD.Y, trackNode.UiD.Z,
210210
"red", TypeOfPointOnApiMap.Track, "track");
211211
}
212212

213213
if ((trackNode.TrJunctionNode != null) && (trackNode.TrJunctionNode.TN.UiD != null))
214214
{
215-
InfoApiMap.addToPointOnApiMap(
215+
infoApiMap.AddToPointOnApiMap(
216216
trackNode.TrJunctionNode.TN.UiD.TileX, trackNode.TrJunctionNode.TN.UiD.TileZ,
217217
trackNode.TrJunctionNode.TN.UiD.X, trackNode.TrJunctionNode.TN.UiD.Y, trackNode.TrJunctionNode.TN.UiD.Z,
218218
"red", TypeOfPointOnApiMap.Track, "track");
@@ -225,16 +225,16 @@ public void AddTrNodesToPointsOnApiMap(InfoApiMap InfoApiMap)
225225
TrVectorSection trVectorSectionLast = null;
226226
foreach (TrVectorSection trVectorSection in trackNode.TrVectorNode.TrVectorSections)
227227
{
228-
LatLon latLonTo = InfoApiMap.convertToLatLon(trVectorSection.TileX, trVectorSection.TileZ,
228+
LatLon latLonTo = InfoApiMap.ConvertToLatLon(trVectorSection.TileX, trVectorSection.TileZ,
229229
trVectorSection.X, trVectorSection.Y, trVectorSection.Z);
230-
InfoApiMap.addToPointOnApiMap(latLonTo, "red", TypeOfPointOnApiMap.Track, "track");
230+
infoApiMap.AddToPointOnApiMap(latLonTo, "red", TypeOfPointOnApiMap.Track, "track");
231231
if (first)
232232
{
233233
first = false;
234234
}
235235
else
236236
{
237-
InfoApiMap.addToLineOnApiMap(latLonFrom, latLonTo);
237+
infoApiMap.AddToLineOnApiMap(latLonFrom, latLonTo);
238238
}
239239
latLonFrom = latLonTo;
240240
trVectorSectionLast = trVectorSection;
@@ -244,26 +244,26 @@ public void AddTrNodesToPointsOnApiMap(InfoApiMap InfoApiMap)
244244
if (trackNode.TrPins.Length == 2)
245245
{
246246
int link = trackNode.TrPins[1].Link;
247-
LatLon latLonTo = InfoApiMap.convertToLatLon(TrackNodes[link].UiD.TileX, TrackNodes[link].UiD.TileZ,
247+
LatLon latLonTo = InfoApiMap.ConvertToLatLon(TrackNodes[link].UiD.TileX, TrackNodes[link].UiD.TileZ,
248248
TrackNodes[link].UiD.X, TrackNodes[link].UiD.Y, TrackNodes[link].UiD.Z);
249-
InfoApiMap.addToLineOnApiMap(latLonFrom, latLonTo);
249+
infoApiMap.AddToLineOnApiMap(latLonFrom, latLonTo);
250250
}
251251
}
252252
}
253253

254254
if (trackNode.TrEndNode)
255255
{
256-
LatLon latLonFrom = InfoApiMap.convertToLatLon(
256+
LatLon latLonFrom = InfoApiMap.ConvertToLatLon(
257257
trackNode.UiD.TileX, trackNode.UiD.TileZ,
258258
trackNode.UiD.X, trackNode.UiD.Y, trackNode.UiD.Z);
259259
int lastIndex = TrackNodes[trackNode.TrPins[0].Link].TrVectorNode.TrVectorSections.Length - 1;
260-
LatLon latLonTo = InfoApiMap.convertToLatLon(
260+
LatLon latLonTo = InfoApiMap.ConvertToLatLon(
261261
TrackNodes[trackNode.TrPins[0].Link].TrVectorNode.TrVectorSections[lastIndex].TileX,
262262
TrackNodes[trackNode.TrPins[0].Link].TrVectorNode.TrVectorSections[lastIndex].TileZ,
263263
TrackNodes[trackNode.TrPins[0].Link].TrVectorNode.TrVectorSections[lastIndex].X,
264264
TrackNodes[trackNode.TrPins[0].Link].TrVectorNode.TrVectorSections[lastIndex].Y,
265265
TrackNodes[trackNode.TrPins[0].Link].TrVectorNode.TrVectorSections[lastIndex].Z);
266-
InfoApiMap.addToLineOnApiMap(latLonFrom, latLonTo);
266+
infoApiMap.AddToLineOnApiMap(latLonFrom, latLonTo);
267267
}
268268
}
269269
catch (Exception e)
@@ -275,7 +275,7 @@ public void AddTrNodesToPointsOnApiMap(InfoApiMap InfoApiMap)
275275
}
276276
}
277277

278-
public void AddTrItemsToPointsOnApiMap(InfoApiMap InfoApiMap)
278+
public void AddTrItemsToPointsOnApiMap(InfoApiMap infoApiMap)
279279
{
280280
foreach (TrItem trItem in TrItemTable)
281281
{
@@ -290,14 +290,14 @@ public void AddTrItemsToPointsOnApiMap(InfoApiMap InfoApiMap)
290290
{
291291
if (trItem.ItemName == null)
292292
{
293-
InfoApiMap.addToPointOnApiMap(
293+
infoApiMap.AddToPointOnApiMap(
294294
trItem.TileX, trItem.TileZ,
295295
trItem.X, trItem.Y, trItem.Z,
296296
"blue", TypeOfPointOnApiMap.Rest, $"{itemType}");
297297
}
298298
else
299299
{
300-
InfoApiMap.addToPointOnApiMap(
300+
infoApiMap.AddToPointOnApiMap(
301301
trItem.TileX, trItem.TileZ,
302302
trItem.X, trItem.Y, trItem.Z,
303303
"green", TypeOfPointOnApiMap.Named, $"{trItem.ItemName.Replace("'", "")}, {itemType}");

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3375,10 +3375,6 @@ public LatLonDirection GetLatLonDirection()
33753375
{
33763376
directionDeg += 180.0f;
33773377
}
3378-
if (Flipped)
3379-
{
3380-
directionDeg += 180.0f;
3381-
}
33823378
var loco = this as MSTSLocomotive;
33833379
if (loco.UsingRearCab)
33843380
{

0 commit comments

Comments
 (0)