Example #1
0
        public void Read(Stream input, Endian endian = Endian.Little)
        {
            RoadGraphEdgeIndex         = input.ReadValueU16(endian);
            OppositeRoadGraphEdgeIndex = input.ReadValueU16(endian);
            OppositeLanesCount         = input.ReadValueU8();
            ForwardLanesCount          = input.ReadValueU8();
            RoadType = (RoadType)input.ReadValueU8();

            byte lanesCount = input.ReadValueU8();

            for (int i = 0; i < lanesCount; i++)
            {
                var lane = new LaneDefinitionDe();
                lane.Read(input, endian);
                Lanes.Add(lane);
            }

            ushort rangeFlagsCount = input.ReadValueU16(endian);

            for (int i = 0; i < rangeFlagsCount; i++)
            {
                var rangeFlag = new RangeFlagDe();
                rangeFlag.Read(input, endian);
                RangeFlags.Add(rangeFlag);
            }

            RoadSplineIndex = input.ReadValueU16(endian);
            MaxSpawnedCars  = input.ReadValueU8();
            Direction       = (RoadDirection)input.ReadValueU8();
        }
Example #2
0
        public void Read(Stream input, Endian endian = Endian.Little)
        {
            Width             = input.ReadValueF32(endian);
            CenterOffset      = input.ReadValueU16(endian);
            _laneTypeAndFlags = input.ReadValueU8();
            ushort rangeFlagsCount = input.ReadValueU16(endian);

            for (int i = 0; i < rangeFlagsCount; i++)
            {
                var rangeFlag = new RangeFlagDe();
                rangeFlag.Read(input, endian);
                RangeFlags.Add(rangeFlag);
            }
        }