You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Check to see if coupler is opened or closed - only closed or opened couplers have been specified
5675
-
// It is assumed that the front coupler on first car will always be opened, and so will the coupler on last car. All others on the train will be coupled
5676
-
if (i == 0) // first car
5677
-
{
5678
-
if (car.FrontCouplerOpenFitted)
5679
-
{
5680
-
5681
-
car.FrontCouplerOpen = true;
5682
-
}
5683
-
else
5684
-
{
5685
-
car.FrontCouplerOpen = false;
5686
-
}
5687
-
}
5688
-
else
5689
-
{
5690
-
car.FrontCouplerOpen = false;
5691
-
}
5692
-
5693
-
// Set up coupler information for last car
5694
-
if (i == Cars.Count - 2) // 2nd last car in count, but set up last car, ie i+1
5695
-
{
5696
-
5697
-
if (Cars[i + 1].RearCouplerOpenFitted)
5698
-
{
5699
-
Cars[i + 1].RearCouplerOpen = true;
5700
-
}
5701
-
else
5702
-
{
5703
-
Cars[i + 1].RearCouplerOpen = false;
5704
-
}
5705
-
5706
-
}
5707
-
else
5708
-
{
5709
-
car.RearCouplerOpen = false;
5710
-
}
5711
-
5712
-
5674
+
// Update coupler open/closed status; it is assumed that:
5675
+
// - the front coupler on first car will always be open
5676
+
// - the rear coupler on last car will always be open
5677
+
// - all others will be closed
5678
+
car.FrontCoupler.IsOpen = i == 0;
5679
+
car.RearCoupler.IsOpen = i == Cars.Count - 1;
5713
5680
5714
5681
TotalCouplerSlackM += car.CouplerSlackM; // Total coupler slack displayed in HUD only
0 commit comments