@@ -422,28 +422,28 @@ public virtual void LoadFromWagFile(string wagFilePath)
422
422
InteriorShapeFileName = null ;
423
423
}
424
424
425
- if ( FrontCouplerShapeFileName != null && ! File . Exists ( wagonFolderSlash + FrontCouplerShapeFileName ) )
425
+ if ( FrontCoupler . Closed . ShapeFileName != null && ! File . Exists ( wagonFolderSlash + FrontCoupler . Closed . ShapeFileName ) )
426
426
{
427
- Trace . TraceWarning ( "{0} references non-existent shape {1}" , WagFilePath , wagonFolderSlash + FrontCouplerShapeFileName ) ;
428
- FrontCouplerShapeFileName = null ;
427
+ Trace . TraceWarning ( "{0} references non-existent shape {1}" , WagFilePath , wagonFolderSlash + FrontCoupler . Closed . ShapeFileName ) ;
428
+ FrontCoupler . Closed . ShapeFileName = null ;
429
429
}
430
430
431
- if ( RearCouplerShapeFileName != null && ! File . Exists ( wagonFolderSlash + RearCouplerShapeFileName ) )
431
+ if ( RearCoupler . Closed . ShapeFileName != null && ! File . Exists ( wagonFolderSlash + RearCoupler . Closed . ShapeFileName ) )
432
432
{
433
- Trace . TraceWarning ( "{0} references non-existent shape {1}" , WagFilePath , wagonFolderSlash + RearCouplerShapeFileName ) ;
434
- RearCouplerShapeFileName = null ;
433
+ Trace . TraceWarning ( "{0} references non-existent shape {1}" , WagFilePath , wagonFolderSlash + RearCoupler . Closed . ShapeFileName ) ;
434
+ RearCoupler . Closed . ShapeFileName = null ;
435
435
}
436
436
437
- if ( FrontAirHoseShapeFileName != null && ! File . Exists ( wagonFolderSlash + FrontAirHoseShapeFileName ) )
437
+ if ( FrontAirHose . Connected . ShapeFileName != null && ! File . Exists ( wagonFolderSlash + FrontAirHose . Connected . ShapeFileName ) )
438
438
{
439
- Trace . TraceWarning ( "{0} references non-existent shape {1}" , WagFilePath , wagonFolderSlash + FrontAirHoseShapeFileName ) ;
440
- FrontAirHoseShapeFileName = null ;
439
+ Trace . TraceWarning ( "{0} references non-existent shape {1}" , WagFilePath , wagonFolderSlash + FrontAirHose . Connected . ShapeFileName ) ;
440
+ FrontAirHose . Connected . ShapeFileName = null ;
441
441
}
442
442
443
- if ( RearAirHoseShapeFileName != null && ! File . Exists ( wagonFolderSlash + RearAirHoseShapeFileName ) )
443
+ if ( RearAirHose . Connected . ShapeFileName != null && ! File . Exists ( wagonFolderSlash + RearAirHose . Connected . ShapeFileName ) )
444
444
{
445
- Trace . TraceWarning ( "{0} references non-existent shape {1}" , WagFilePath , wagonFolderSlash + RearAirHoseShapeFileName ) ;
446
- RearAirHoseShapeFileName = null ;
445
+ Trace . TraceWarning ( "{0} references non-existent shape {1}" , WagFilePath , wagonFolderSlash + RearAirHose . Connected . ShapeFileName ) ;
446
+ RearAirHose . Connected . ShapeFileName = null ;
447
447
}
448
448
449
449
// If trailing loco resistance constant has not been defined in WAG/ENG file then assign default value based upon orig Davis values
@@ -1224,37 +1224,29 @@ public virtual void Parse(string lowercasetoken, STFReader stf)
1224
1224
1225
1225
case "wagon(coupling(frontcoupleranim" :
1226
1226
stf . MustMatch ( "(" ) ;
1227
- FrontCouplerShapeFileName = stf . ReadString ( ) ;
1228
- FrontCouplerAnimWidthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1229
- FrontCouplerAnimHeightM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1230
- FrontCouplerAnimLengthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1227
+ FrontCoupler . Closed . ShapeFileName = stf . ReadString ( ) ;
1228
+ FrontCoupler . Size = stf . ReadVector3 ( STFReader . UNITS . Distance , Vector3 . Zero ) ;
1231
1229
stf . SkipRestOfBlock ( ) ;
1232
1230
break ;
1233
1231
1234
1232
case "wagon(coupling(frontairhoseanim" :
1235
1233
stf . MustMatch ( "(" ) ;
1236
- FrontAirHoseShapeFileName = stf . ReadString ( ) ;
1237
- FrontAirHoseAnimWidthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1238
- FrontAirHoseAnimHeightM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1239
- FrontAirHoseAnimLengthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1234
+ FrontAirHose . Connected . ShapeFileName = stf . ReadString ( ) ;
1235
+ FrontAirHose . Size = stf . ReadVector3 ( STFReader . UNITS . Distance , Vector3 . Zero ) ;
1240
1236
stf . SkipRestOfBlock ( ) ;
1241
1237
break ;
1242
1238
1243
1239
case "wagon(coupling(rearcoupleranim" :
1244
1240
stf . MustMatch ( "(" ) ;
1245
- RearCouplerShapeFileName = stf . ReadString ( ) ;
1246
- RearCouplerAnimWidthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1247
- RearCouplerAnimHeightM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1248
- RearCouplerAnimLengthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1241
+ RearCoupler . Closed . ShapeFileName = stf . ReadString ( ) ;
1242
+ RearCoupler . Size = stf . ReadVector3 ( STFReader . UNITS . Distance , Vector3 . Zero ) ;
1249
1243
stf . SkipRestOfBlock ( ) ;
1250
1244
break ;
1251
1245
1252
1246
case "wagon(coupling(rearairhoseanim" :
1253
1247
stf . MustMatch ( "(" ) ;
1254
- RearAirHoseShapeFileName = stf . ReadString ( ) ;
1255
- RearAirHoseAnimWidthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1256
- RearAirHoseAnimHeightM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1257
- RearAirHoseAnimLengthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1248
+ RearAirHose . Connected . ShapeFileName = stf . ReadString ( ) ;
1249
+ RearAirHose . Size = stf . ReadVector3 ( STFReader . UNITS . Distance , Vector3 . Zero ) ;
1258
1250
stf . SkipRestOfBlock ( ) ;
1259
1251
break ;
1260
1252
@@ -1266,39 +1258,29 @@ public virtual void Parse(string lowercasetoken, STFReader stf)
1266
1258
1267
1259
case "wagon(coupling(frontcoupleropenanim" :
1268
1260
stf . MustMatch ( "(" ) ;
1269
- FrontCouplerOpenFitted = true ;
1270
- FrontCouplerOpenShapeFileName = stf . ReadString ( ) ;
1271
- FrontCouplerOpenAnimWidthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1272
- FrontCouplerOpenAnimHeightM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1273
- FrontCouplerOpenAnimLengthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1261
+ FrontCoupler . Open . ShapeFileName = stf . ReadString ( ) ;
1262
+ // NOTE: Skip reading the size as it is unused: stf.ReadVector3(STFReader.UNITS.Distance, Vector3.Zero);
1274
1263
stf . SkipRestOfBlock ( ) ;
1275
1264
break ;
1276
1265
1277
1266
case "wagon(coupling(rearcoupleropenanim" :
1278
1267
stf . MustMatch ( "(" ) ;
1279
- RearCouplerOpenFitted = true ;
1280
- RearCouplerOpenShapeFileName = stf . ReadString ( ) ;
1281
- RearCouplerOpenAnimWidthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1282
- RearCouplerOpenAnimHeightM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1283
- RearCouplerOpenAnimLengthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1268
+ RearCoupler . Open . ShapeFileName = stf . ReadString ( ) ;
1269
+ // NOTE: Skip reading the size as it is unused: stf.ReadVector3(STFReader.UNITS.Distance, Vector3.Zero);
1284
1270
stf . SkipRestOfBlock ( ) ;
1285
1271
break ;
1286
1272
1287
1273
case "wagon(coupling(frontairhosediconnectedanim" :
1288
1274
stf . MustMatch ( "(" ) ;
1289
- FrontAirHoseDisconnectedShapeFileName = stf . ReadString ( ) ;
1290
- FrontAirHoseDisconnectedAnimWidthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1291
- FrontAirHoseDisconnectedAnimHeightM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1292
- FrontAirHoseDisconnectedAnimLengthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1275
+ FrontAirHose . Disconnected . ShapeFileName = stf . ReadString ( ) ;
1276
+ // NOTE: Skip reading the size as it is unused: stf.ReadVector3(STFReader.UNITS.Distance, Vector3.Zero);
1293
1277
stf . SkipRestOfBlock ( ) ;
1294
1278
break ;
1295
1279
1296
1280
case "wagon(coupling(rearairhosediconnectedanim" :
1297
1281
stf . MustMatch ( "(" ) ;
1298
- RearAirHoseDisconnectedShapeFileName = stf . ReadString ( ) ;
1299
- RearAirHoseDisconnectedAnimWidthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1300
- RearAirHoseDisconnectedAnimHeightM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1301
- RearAirHoseDisconnectedAnimLengthM = stf . ReadFloat ( STFReader . UNITS . Distance , null ) ;
1282
+ RearAirHose . Disconnected . ShapeFileName = stf . ReadString ( ) ;
1283
+ // NOTE: Skip reading the size as it is unused: stf.ReadVector3(STFReader.UNITS.Distance, Vector3.Zero);
1302
1284
stf . SkipRestOfBlock ( ) ;
1303
1285
break ;
1304
1286
@@ -1450,44 +1432,10 @@ public virtual void Copy(MSTSWagon copy)
1450
1432
FreightAnimMaxLevelM = copy . FreightAnimMaxLevelM ;
1451
1433
FreightAnimMinLevelM = copy . FreightAnimMinLevelM ;
1452
1434
FreightAnimFlag = copy . FreightAnimFlag ;
1453
- FrontCouplerShapeFileName = copy . FrontCouplerShapeFileName ;
1454
- FrontCouplerAnimWidthM = copy . FrontCouplerAnimWidthM ;
1455
- FrontCouplerAnimHeightM = copy . FrontCouplerAnimHeightM ;
1456
- FrontCouplerAnimLengthM = copy . FrontCouplerAnimLengthM ;
1457
- FrontCouplerOpenShapeFileName = copy . FrontCouplerOpenShapeFileName ;
1458
- FrontCouplerOpenAnimWidthM = copy . FrontCouplerOpenAnimWidthM ;
1459
- FrontCouplerOpenAnimHeightM = copy . FrontCouplerOpenAnimHeightM ;
1460
- FrontCouplerOpenAnimLengthM = copy . FrontCouplerOpenAnimLengthM ;
1461
- FrontCouplerOpenFitted = copy . FrontCouplerOpenFitted ;
1462
- RearCouplerShapeFileName = copy . RearCouplerShapeFileName ;
1463
- RearCouplerAnimWidthM = copy . RearCouplerAnimWidthM ;
1464
- RearCouplerAnimHeightM = copy . RearCouplerAnimHeightM ;
1465
- RearCouplerAnimLengthM = copy . RearCouplerAnimLengthM ;
1466
- RearCouplerOpenShapeFileName = copy . RearCouplerOpenShapeFileName ;
1467
- RearCouplerOpenAnimWidthM = copy . RearCouplerOpenAnimWidthM ;
1468
- RearCouplerOpenAnimHeightM = copy . RearCouplerOpenAnimHeightM ;
1469
- RearCouplerOpenAnimLengthM = copy . RearCouplerOpenAnimLengthM ;
1470
- RearCouplerOpenFitted = copy . RearCouplerOpenFitted ;
1471
-
1472
- FrontAirHoseShapeFileName = copy . FrontAirHoseShapeFileName ;
1473
- FrontAirHoseAnimWidthM = copy . FrontAirHoseAnimWidthM ;
1474
- FrontAirHoseAnimHeightM = copy . FrontAirHoseAnimHeightM ;
1475
- FrontAirHoseAnimLengthM = copy . FrontAirHoseAnimLengthM ;
1476
-
1477
- FrontAirHoseDisconnectedShapeFileName = copy . FrontAirHoseDisconnectedShapeFileName ;
1478
- FrontAirHoseDisconnectedAnimWidthM = copy . FrontAirHoseDisconnectedAnimWidthM ;
1479
- FrontAirHoseDisconnectedAnimHeightM = copy . FrontAirHoseDisconnectedAnimHeightM ;
1480
- FrontAirHoseDisconnectedAnimLengthM = copy . FrontAirHoseDisconnectedAnimLengthM ;
1481
-
1482
- RearAirHoseShapeFileName = copy . RearAirHoseShapeFileName ;
1483
- RearAirHoseAnimWidthM = copy . RearAirHoseAnimWidthM ;
1484
- RearAirHoseAnimHeightM = copy . RearAirHoseAnimHeightM ;
1485
- RearAirHoseAnimLengthM = copy . RearAirHoseAnimLengthM ;
1486
-
1487
- RearAirHoseDisconnectedShapeFileName = copy . RearAirHoseDisconnectedShapeFileName ;
1488
- RearAirHoseDisconnectedAnimWidthM = copy . RearAirHoseDisconnectedAnimWidthM ;
1489
- RearAirHoseDisconnectedAnimHeightM = copy . RearAirHoseDisconnectedAnimHeightM ;
1490
- RearAirHoseDisconnectedAnimLengthM = copy . RearAirHoseDisconnectedAnimLengthM ;
1435
+ FrontCoupler = copy . FrontCoupler ;
1436
+ RearCoupler = copy . RearCoupler ;
1437
+ FrontAirHose = copy . FrontAirHose ;
1438
+ RearAirHose = copy . RearAirHose ;
1491
1439
1492
1440
CarWidthM = copy . CarWidthM ;
1493
1441
CarHeightM = copy . CarHeightM ;
0 commit comments