@@ -422,28 +422,28 @@ public virtual void LoadFromWagFile(string wagFilePath)
422422 InteriorShapeFileName = null ;
423423 }
424424
425- if ( FrontCouplerShapeFileName != null && ! File . Exists ( wagonFolderSlash + FrontCouplerShapeFileName ) )
425+ if ( FrontCoupler . Closed . ShapeFileName != null && ! File . Exists ( wagonFolderSlash + FrontCoupler . Closed . ShapeFileName ) )
426426 {
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 ;
429429 }
430430
431- if ( RearCouplerShapeFileName != null && ! File . Exists ( wagonFolderSlash + RearCouplerShapeFileName ) )
431+ if ( RearCoupler . Closed . ShapeFileName != null && ! File . Exists ( wagonFolderSlash + RearCoupler . Closed . ShapeFileName ) )
432432 {
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 ;
435435 }
436436
437- if ( FrontAirHoseShapeFileName != null && ! File . Exists ( wagonFolderSlash + FrontAirHoseShapeFileName ) )
437+ if ( FrontAirHose . Connected . ShapeFileName != null && ! File . Exists ( wagonFolderSlash + FrontAirHose . Connected . ShapeFileName ) )
438438 {
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 ;
441441 }
442442
443- if ( RearAirHoseShapeFileName != null && ! File . Exists ( wagonFolderSlash + RearAirHoseShapeFileName ) )
443+ if ( RearAirHose . Connected . ShapeFileName != null && ! File . Exists ( wagonFolderSlash + RearAirHose . Connected . ShapeFileName ) )
444444 {
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 ;
447447 }
448448
449449 // 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)
12241224
12251225 case "wagon(coupling(frontcoupleranim" :
12261226 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 ) ;
12311229 stf . SkipRestOfBlock ( ) ;
12321230 break ;
12331231
12341232 case "wagon(coupling(frontairhoseanim" :
12351233 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 ) ;
12401236 stf . SkipRestOfBlock ( ) ;
12411237 break ;
12421238
12431239 case "wagon(coupling(rearcoupleranim" :
12441240 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 ) ;
12491243 stf . SkipRestOfBlock ( ) ;
12501244 break ;
12511245
12521246 case "wagon(coupling(rearairhoseanim" :
12531247 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 ) ;
12581250 stf . SkipRestOfBlock ( ) ;
12591251 break ;
12601252
@@ -1266,39 +1258,29 @@ public virtual void Parse(string lowercasetoken, STFReader stf)
12661258
12671259 case "wagon(coupling(frontcoupleropenanim" :
12681260 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);
12741263 stf . SkipRestOfBlock ( ) ;
12751264 break ;
12761265
12771266 case "wagon(coupling(rearcoupleropenanim" :
12781267 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);
12841270 stf . SkipRestOfBlock ( ) ;
12851271 break ;
12861272
12871273 case "wagon(coupling(frontairhosediconnectedanim" :
12881274 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);
12931277 stf . SkipRestOfBlock ( ) ;
12941278 break ;
12951279
12961280 case "wagon(coupling(rearairhosediconnectedanim" :
12971281 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);
13021284 stf . SkipRestOfBlock ( ) ;
13031285 break ;
13041286
@@ -1450,44 +1432,10 @@ public virtual void Copy(MSTSWagon copy)
14501432 FreightAnimMaxLevelM = copy . FreightAnimMaxLevelM ;
14511433 FreightAnimMinLevelM = copy . FreightAnimMinLevelM ;
14521434 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 ;
14911439
14921440 CarWidthM = copy . CarWidthM ;
14931441 CarHeightM = copy . CarHeightM ;
0 commit comments