2323using Orts . MultiPlayer ;
2424using Orts . Simulation . Physics ;
2525using Orts . Simulation . Signalling ;
26+ using Orts . Viewer3D . Debugging ;
2627
27- namespace Orts . Viewer3D . Debugging
28+ namespace Orts . Viewer3D . Map
2829{
2930 public class MapDataProvider
3031 {
31- public DispatchViewerBeta F { get ; set ; } // Shortest possible abbreviation so code is easier to read
32+ public MapViewer F { get ; set ; } // Shortest possible abbreviation so code is easier to read
3233
33- public MapDataProvider ( DispatchViewerBeta form )
34+ public MapDataProvider ( MapViewer form )
3435 {
3536 F = form ;
3637 }
@@ -92,7 +93,7 @@ public void PopulateItemLists()
9293 {
9394 var oldSiding = F . sidings [ oldSidingIndex ] ;
9495 var oldLocation = oldSiding . Location ;
95- var newLocation = new PointF ( ( item . TileX * 2048 ) + item . X , ( item . TileZ * 2048 ) + item . Z ) ;
96+ var newLocation = new PointF ( item . TileX * 2048 + item . X , item . TileZ * 2048 + item . Z ) ;
9697
9798 // Because these are structs, not classes, compiler won't let you overwrite them.
9899 // Instead create a single item which replaces the 2 platform items.
@@ -117,15 +118,15 @@ public void PopulateItemLists()
117118 {
118119 var newPlatform = new PlatformWidget ( item as PlatformItem )
119120 {
120- Extent1 = new PointF ( ( item . TileX * 2048 ) + item . X , ( item . TileZ * 2048 ) + item . Z )
121+ Extent1 = new PointF ( item . TileX * 2048 + item . X , item . TileZ * 2048 + item . Z )
121122 } ;
122123 F . platforms . Add ( newPlatform ) ;
123124 }
124125 else
125126 {
126127 var oldPlatform = F . platforms [ oldPlatformIndex ] ;
127128 var oldLocation = oldPlatform . Location ;
128- var newLocation = new PointF ( ( item . TileX * 2048 ) + item . X , ( item . TileZ * 2048 ) + item . Z ) ;
129+ var newLocation = new PointF ( item . TileX * 2048 + item . X , item . TileZ * 2048 + item . Z ) ;
129130
130131 // Because these are structs, not classes, compiler won't let you overwrite them.
131132 // Instead create a single item which replaces the 2 platform items.
@@ -174,7 +175,7 @@ private PointF GetMidPoint(PointF location1, PointF location2)
174175
175176 private PointF GetRightHandPoint ( PointF location1 , PointF location2 )
176177 {
177- return ( location1 . X > location2 . X ) ? location1 : location2 ;
178+ return location1 . X > location2 . X ? location1 : location2 ;
178179 }
179180
180181 public void ShowSimulationTime ( )
@@ -203,9 +204,9 @@ public void FixForBadData(float width, ref PointF scaledA, ref PointF scaledB, P
203204 public bool IsActiveTrain ( Simulation . AIs . AITrain t )
204205 {
205206 return t != null
206- && ( ( t . MovementState != Simulation . AIs . AITrain . AI_MOVEMENT_STATE . AI_STATIC
207+ && ( t . MovementState != Simulation . AIs . AITrain . AI_MOVEMENT_STATE . AI_STATIC
207208 && ! ( t . TrainType == Train . TRAINTYPE . AI_INCORPORATED && ! t . IncorporatingTrain . IsPathless )
208- )
209+
209210 || t . TrainType == Train . TRAINTYPE . PLAYER ) ;
210211 }
211212
@@ -249,19 +250,19 @@ public float GetUnusedYLocation(float startX, float wantY, string name)
249250 const float noFreeSlotFound = - 1f ;
250251
251252 var desiredPositionY = ( int ) ( wantY / DispatchViewer . spacing ) ; // The positionY of the ideal row for the text.
252- var endX = startX + ( name . Length * F . trainFont . Size ) ;
253+ var endX = startX + name . Length * F . trainFont . Size ;
253254 //out of drawing area
254255 if ( endX < 0 )
255256 return noFreeSlotFound ;
256257
257- int positionY = desiredPositionY ;
258+ var positionY = desiredPositionY ;
258259 while ( positionY >= 0 && positionY < F . alignedTextY . Length )
259260 {
260261 //if the line contains no text yet, put it there
261262 if ( F . alignedTextNum [ positionY ] == 0 )
262263 return SaveLabelLocation ( startX , endX , positionY ) ;
263264
264- bool conflict = false ;
265+ var conflict = false ;
265266
266267 //check if it intersects with any labels already in this row
267268 for ( var col = 0 ; col < F . alignedTextNum [ positionY ] ; col ++ )
0 commit comments