Skip to content

Commit a0eae37

Browse files
PascalCase for al C# items
1 parent 5fdb384 commit a0eae37

File tree

5 files changed

+98
-100
lines changed

5 files changed

+98
-100
lines changed

Source/ORTS.Common/InfoApiMap.cs

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -22,66 +22,66 @@
2222
namespace Orts.Common
2323
{
2424
public enum TypeOfPointOnApiMap {
25-
track,
26-
named,
27-
rest
25+
Track,
26+
Named,
27+
Rest
2828
}
2929

3030
public class PointOnApiMap
3131
{
32-
public LatLon latLon;
33-
public string color;
34-
public TypeOfPointOnApiMap typeOfPointOnApiMap;
35-
public string name;
32+
public LatLon LatLon;
33+
public string Color;
34+
public TypeOfPointOnApiMap TypeOfPointOnApiMap;
35+
public string Name;
3636
}
3737

3838
public class LineOnApiMap
3939
{
40-
public LatLon latLonFrom;
41-
public LatLon latLonTo;
40+
public LatLon LatLonFrom;
41+
public LatLon LatLonTo;
4242
}
4343

4444
public class InfoApiMap
4545
{
46-
public string typeOfLocomotive;
46+
public string TypeOfLocomotive;
4747

48-
public LinkedList<PointOnApiMap> pointOnApiMapList;
49-
public LinkedList<LineOnApiMap> lineOnApiMapList;
48+
public LinkedList<PointOnApiMap> PointOnApiMapList;
49+
public LinkedList<LineOnApiMap> LineOnApiMapList;
5050

51-
public float latMin;
52-
public float latMax;
53-
public float lonMin;
54-
public float lonMax;
51+
public float LatMin;
52+
public float LatMax;
53+
public float LonMin;
54+
public float LonMax;
5555

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

60-
pointOnApiMapList = new LinkedList<PointOnApiMap>();
61-
lineOnApiMapList = new LinkedList<LineOnApiMap>();
60+
PointOnApiMapList = new LinkedList<PointOnApiMap>();
61+
LineOnApiMapList = new LinkedList<LineOnApiMap>();
6262

63-
latMax = -999999f;
64-
latMin = +999999f;
65-
lonMax = -999999f;
66-
lonMin = +999999f;
63+
LatMax = -999999f;
64+
LatMin = +999999f;
65+
LonMax = -999999f;
66+
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
{
74-
typeOfLocomotive = "steam";
74+
TypeOfLocomotive = "steam";
7575
}
7676
else
7777
{
7878
if (powerSupplyNameToLower.Contains("diesel"))
7979
{
80-
typeOfLocomotive = "diesel";
80+
TypeOfLocomotive = "diesel";
8181
}
8282
else
8383
{
84-
typeOfLocomotive = "electric";
84+
TypeOfLocomotive = "electric";
8585
}
8686
}
8787
}
@@ -100,62 +100,62 @@ public static LatLon convertToLatLon(int TileX, int TileZ, float X, float Y, flo
100100

101101
public void addToPointOnApiMap(
102102
int TileX, int TileZ, float X, float Y, float Z,
103-
string color, TypeOfPointOnApiMap typeOfPointOnApiMap, string name)
103+
string Color, TypeOfPointOnApiMap TypeOfPointOnApiMap, string Name)
104104
{
105105
LatLon latLon = InfoApiMap.convertToLatLon(TileX, TileZ, X, Y, Z);
106106

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

111111
public void addToPointOnApiMap(
112-
LatLon latLon,
113-
string color, TypeOfPointOnApiMap typeOfPointOnApiMap, string name)
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

123-
if (pointOnApiMap.typeOfPointOnApiMap == TypeOfPointOnApiMap.named)
123+
if (pointOnApiMap.TypeOfPointOnApiMap == TypeOfPointOnApiMap.Named)
124124
{
125125
// named last is the list so that they get displayed on top
126-
pointOnApiMapList.AddLast(pointOnApiMap);
126+
PointOnApiMapList.AddLast(pointOnApiMap);
127127
}
128128
else
129129
{
130-
pointOnApiMapList.AddFirst(pointOnApiMap);
130+
PointOnApiMapList.AddFirst(pointOnApiMap);
131131
}
132132

133-
if (pointOnApiMap.latLon.Lat > latMax)
133+
if (pointOnApiMap.LatLon.Lat > LatMax)
134134
{
135-
latMax = pointOnApiMap.latLon.Lat;
135+
LatMax = pointOnApiMap.LatLon.Lat;
136136
}
137-
if (pointOnApiMap.latLon.Lat < latMin)
137+
if (pointOnApiMap.LatLon.Lat < LatMin)
138138
{
139-
latMin = pointOnApiMap.latLon.Lat;
139+
LatMin = pointOnApiMap.LatLon.Lat;
140140
}
141-
if (pointOnApiMap.latLon.Lon > lonMax)
141+
if (pointOnApiMap.LatLon.Lon > LonMax)
142142
{
143-
lonMax = pointOnApiMap.latLon.Lon;
143+
LonMax = pointOnApiMap.LatLon.Lon;
144144
}
145-
if (pointOnApiMap.latLon.Lon < lonMin)
145+
if (pointOnApiMap.LatLon.Lon < LonMin)
146146
{
147-
lonMin = pointOnApiMap.latLon.Lon;
147+
LonMin = pointOnApiMap.LatLon.Lon;
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
};
158-
lineOnApiMapList.AddLast(lineOnApiMap);
158+
LineOnApiMapList.AddLast(lineOnApiMap);
159159
}
160160
}
161161
}

Source/ORTS.Common/WorldLatLon.cs

Lines changed: 7 additions & 7 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-
Lat = lat;
302-
Lon = lon;
301+
this.Lat = Lat;
302+
this.Lon = Lon;
303303
}
304304
}
305305

@@ -309,12 +309,12 @@ public LatLon(float lat, float lon)
309309
public class LatLonDirection
310310
{
311311
public LatLon LatLon { get; }
312-
public float directionDeg { get; }
312+
public float DirectionDeg { get; }
313313

314-
public LatLonDirection(LatLon latLon, float directionDeg)
314+
public LatLonDirection(LatLon LatLon, float DirectionDeg)
315315
{
316-
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 apiMapInfo)
197+
public void AddTrNodesToPointsOnApiMap(InfoApiMap InfoApiMap)
198198
{
199199
foreach (TrackNode trackNode in TrackNodes)
200200
{
@@ -204,18 +204,18 @@ public void addTrNodesToPointsOnApiMap(InfoApiMap apiMapInfo)
204204
{
205205
if (trackNode.UiD != null)
206206
{
207-
apiMapInfo.addToPointOnApiMap(
207+
InfoApiMap.addToPointOnApiMap(
208208
trackNode.UiD.TileX, trackNode.UiD.TileZ,
209209
trackNode.UiD.X, trackNode.UiD.Y, trackNode.UiD.Z,
210-
"red", TypeOfPointOnApiMap.track, "track");
210+
"red", TypeOfPointOnApiMap.Track, "track");
211211
}
212212

213213
if ((trackNode.TrJunctionNode != null) && (trackNode.TrJunctionNode.TN.UiD != null))
214214
{
215-
apiMapInfo.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,
218-
"red", TypeOfPointOnApiMap.track, "track");
218+
"red", TypeOfPointOnApiMap.Track, "track");
219219
}
220220

221221
if ((trackNode.TrVectorNode != null) && (trackNode.TrVectorNode.TrVectorSections != null))
@@ -227,14 +227,14 @@ public void addTrNodesToPointsOnApiMap(InfoApiMap apiMapInfo)
227227
{
228228
LatLon latLonTo = InfoApiMap.convertToLatLon(trVectorSection.TileX, trVectorSection.TileZ,
229229
trVectorSection.X, trVectorSection.Y, trVectorSection.Z);
230-
apiMapInfo.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-
apiMapInfo.addToLineOnApiMap(latLonFrom, latLonTo);
237+
InfoApiMap.addToLineOnApiMap(latLonFrom, latLonTo);
238238
}
239239
latLonFrom = latLonTo;
240240
trVectorSectionLast = trVectorSection;
@@ -246,7 +246,7 @@ public void addTrNodesToPointsOnApiMap(InfoApiMap apiMapInfo)
246246
int link = trackNode.TrPins[1].Link;
247247
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-
apiMapInfo.addToLineOnApiMap(latLonFrom, latLonTo);
249+
InfoApiMap.addToLineOnApiMap(latLonFrom, latLonTo);
250250
}
251251
}
252252
}
@@ -263,7 +263,7 @@ public void addTrNodesToPointsOnApiMap(InfoApiMap apiMapInfo)
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-
apiMapInfo.addToLineOnApiMap(latLonFrom, latLonTo);
266+
InfoApiMap.addToLineOnApiMap(latLonFrom, latLonTo);
267267
}
268268
}
269269
catch (Exception e)
@@ -275,7 +275,7 @@ public void addTrNodesToPointsOnApiMap(InfoApiMap apiMapInfo)
275275
}
276276
}
277277

278-
public void addTrItemsToPointsOnApiMap(InfoApiMap apiMapInfo)
278+
public void AddTrItemsToPointsOnApiMap(InfoApiMap InfoApiMap)
279279
{
280280
foreach (TrItem trItem in TrItemTable)
281281
{
@@ -290,17 +290,17 @@ public void addTrItemsToPointsOnApiMap(InfoApiMap apiMapInfo)
290290
{
291291
if (trItem.ItemName == null)
292292
{
293-
apiMapInfo.addToPointOnApiMap(
293+
InfoApiMap.addToPointOnApiMap(
294294
trItem.TileX, trItem.TileZ,
295295
trItem.X, trItem.Y, trItem.Z,
296-
"blue", TypeOfPointOnApiMap.rest, $"{itemType}");
296+
"blue", TypeOfPointOnApiMap.Rest, $"{itemType}");
297297
}
298298
else
299299
{
300-
apiMapInfo.addToPointOnApiMap(
300+
InfoApiMap.addToPointOnApiMap(
301301
trItem.TileX, trItem.TileZ,
302302
trItem.X, trItem.Y, trItem.Z,
303-
"green", TypeOfPointOnApiMap.named, $"{trItem.ItemName.Replace("'", "")}, {itemType}");
303+
"green", TypeOfPointOnApiMap.Named, $"{trItem.ItemName.Replace("'", "")}, {itemType}");
304304
}
305305
}
306306
}

Source/RunActivity/Viewer3D/WebServices/Web/Map/index.js

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function ApiMapInit() {
9999
namedLayerGroup = L.layerGroup();
100100
restLayerGroup = L.layerGroup();
101101

102-
let locomotiveFile = apiMapInitInfo.typeOfLocomotive.concat("-locomotive-icon.png");
102+
let locomotiveFile = apiMapInitInfo.TypeOfLocomotive.concat("-locomotive-icon.png");
103103
locomotiveIcon = L.icon({
104104
iconUrl: locomotiveFile,
105105
iconSize: [30, 25],
@@ -111,35 +111,35 @@ function ApiMapInit() {
111111
iconAnchor: [15, 50],
112112
});
113113

114-
for (const pointOnMap of apiMapInitInfo.pointOnApiMapList) {
115-
if (pointOnMap.typeOfPointOnApiMap == 0) { // track
116-
L.circle([pointOnMap.latLon.Lat, pointOnMap.latLon.Lon], {
117-
color: pointOnMap.color,
118-
fillColor: pointOnMap.color,
114+
for (const pointOnMap of apiMapInitInfo.PointOnApiMapList) {
115+
if (pointOnMap.TypeOfPointOnApiMap == 0) { // Track
116+
L.circle([pointOnMap.LatLon.Lat, pointOnMap.LatLon.Lon], {
117+
color: pointOnMap.Color,
118+
fillColor: pointOnMap.Color,
119119
fillOpacity: 1,
120120
radius: 1
121121
}).addTo(trackLayerGroup);
122122
}
123-
if (pointOnMap.typeOfPointOnApiMap == 1) { // named
124-
L.circle([pointOnMap.latLon.Lat, pointOnMap.latLon.Lon], {
125-
color: pointOnMap.color,
126-
fillColor: pointOnMap.color,
123+
if (pointOnMap.TypeOfPointOnApiMap == 1) { // Named
124+
L.circle([pointOnMap.LatLon.Lat, pointOnMap.LatLon.Lon], {
125+
color: pointOnMap.Color,
126+
fillColor: pointOnMap.Color,
127127
fillOpacity: 1,
128128
radius: 3
129-
}).addTo(namedLayerGroup).bindPopup(pointOnMap.name);
129+
}).addTo(namedLayerGroup).bindPopup(pointOnMap.Name);
130130
}
131-
if (pointOnMap.typeOfPointOnApiMap == 2) { // rest
132-
L.circle([pointOnMap.latLon.Lat, pointOnMap.latLon.Lon], {
133-
color: pointOnMap.color,
134-
fillColor: pointOnMap.color,
131+
if (pointOnMap.TypeOfPointOnApiMap == 2) { // Rest
132+
L.circle([pointOnMap.LatLon.Lat, pointOnMap.LatLon.Lon], {
133+
color: pointOnMap.Color,
134+
fillColor: pointOnMap.Color,
135135
fillOpacity: 1,
136136
radius: 3
137-
}).addTo(restLayerGroup).bindPopup(pointOnMap.name);
137+
}).addTo(restLayerGroup).bindPopup(pointOnMap.Name);
138138
}
139139
}
140140

141-
for (const lineOnMap of apiMapInitInfo.lineOnApiMapList) {
142-
pointList = [[lineOnMap.latLonFrom.Lat, lineOnMap.latLonFrom.Lon], [lineOnMap.latLonTo.Lat, lineOnMap.latLonTo.Lon]];
141+
for (const lineOnMap of apiMapInitInfo.LineOnApiMapList) {
142+
pointList = [[lineOnMap.LatLonFrom.Lat, lineOnMap.LatLonFrom.Lon], [lineOnMap.LatLonTo.Lat, lineOnMap.LatLonTo.Lon]];
143143
polyline = new L.Polyline(pointList, {
144144
color: 'red',
145145
weight: 1,
@@ -149,7 +149,7 @@ function ApiMapInit() {
149149
polyline.addTo(trackLayerGroup);
150150
}
151151

152-
map.fitBounds([[apiMapInitInfo.latMin, apiMapInitInfo.lonMin], [apiMapInitInfo.latMax, apiMapInitInfo.lonMax]], null);
152+
map.fitBounds([[apiMapInitInfo.LatMin, apiMapInitInfo.LonMin], [apiMapInitInfo.LatMax, apiMapInitInfo.LonMax]], null);
153153

154154
layerControl.addOverlay(trackLayerGroup, 'track');
155155
layerControl.addOverlay(namedLayerGroup, 'named');
@@ -158,6 +158,7 @@ function ApiMapInit() {
158158
baseLayerFound = false;
159159
for (let i = 0; i < localStorage.length; i++) {
160160
key = localStorage.key(i);
161+
value = localStorage.getItem(localStorage.key(i));
161162

162163
if (key == storageBaseLayerKey) {
163164
if (value == "standard") {
@@ -209,7 +210,7 @@ function ApiMap() {
209210

210211
if (latLonObj != null) {
211212

212-
let directionDeg = latLonObj.directionDeg;
213+
let directionDeg = latLonObj.DirectionDeg;
213214
let latLon = [latLonObj.LatLon.Lat, latLonObj.LatLon.Lon];
214215

215216
if (initToBeDone) {

0 commit comments

Comments
 (0)