Beispiel #1
0
 public WorkOrderWagons(STFReader stf, EventType eventType)
 {
     stf.MustMatchBlockStart();
     // "Drop Off" Wagon_List sometimes lacks a Description attribute, so we create the wagon _before_ description
     // is parsed.
     stf.ParseBlock(new STFReader.TokenProcessor[] {
         new STFReader.TokenProcessor("uid", () => { UiD = stf.ReadUIntBlock(null); }),
         new STFReader.TokenProcessor("sidingitem", () => { Add(new WorkOrderWagon(UiD, stf.ReadUIntBlock(null))); }),
         new STFReader.TokenProcessor("description", () => { this[Count - 1].Description = stf.ReadStringBlock(""); }),
     });
 }
Beispiel #2
0
        public TrackShape(STFReader stf)
        {
            stf.MustMatchBlockStart();
            ShapeIndex = stf.ReadUInt(null);
            int nextPath = 0;

            stf.ParseBlock(new STFReader.TokenProcessor[] {
                new STFReader.TokenProcessor("filename", () => { FileName = stf.ReadStringBlock(null); }),
                new STFReader.TokenProcessor("numpaths", () => { SectionIndices = new SectionIndex[PathsNumber = stf.ReadUIntBlock(null)]; }),
                new STFReader.TokenProcessor("mainroute", () => { MainRoute = stf.ReadUIntBlock(null); }),
                new STFReader.TokenProcessor("clearancedist", () => { ClearanceDistance = stf.ReadFloatBlock(STFReader.Units.Distance, null); }),
                new STFReader.TokenProcessor("sectionidx", () => { SectionIndices[nextPath++] = new SectionIndex(stf); }),
                new STFReader.TokenProcessor("tunnelshape", () => { TunnelShape = stf.ReadBoolBlock(true); }),
                new STFReader.TokenProcessor("roadshape", () => { RoadShape = stf.ReadBoolBlock(true); }),
            });
            // TODO - this was removed since TrackShape( 183 ) is blank
            //if( FileName == null )	throw( new STFError( stf, "Missing FileName" ) );
            //if( SectionIdxs == null )	throw( new STFError( stf, "Missing SectionIdxs" ) );
            //if( NumPaths == 0 ) throw( new STFError( stf, "No Paths in TrackShape" ) );
        }