Example #1
0
            void Parse(Stream s)
            {
                BinaryReader r = new BinaryReader(s);

                this.name                   = r.ReadUInt32();
                this.priority               = r.ReadByte();
                this.areaTypeFlags          = (AreaType)r.ReadUInt32();
                this.closedPolygon          = new PolygonPointList(handler, s);
                this.allowIntersectionFlags = (AllowIntersection)r.ReadUInt32();
                this.surfaceTypeFlags       = (SurfaceType)r.ReadUInt32();
                this.surfaceAttributeFlags  = (SurfaceAttribute)r.ReadUInt32();
                this.levelOffset            = r.ReadByte();
                this.elevationOffset        = ParentVersion >= 0x00000007 ? r.ReadSingle() : 0;
                this.lower                  = new PolygonPoint(handler, s);
                this.upper                  = new PolygonPoint(handler, s);
            }
Example #2
0
 public Area(EventHandler handler, uint version,
             uint name, byte priority, AreaType areaTypeFlags, IEnumerable <PolygonPoint> closedPolygon,
             AllowIntersection allowIntersectionFlags, SurfaceType surfaceTypeFlags,
             SurfaceAttribute surfaceAttributeFlags,
             byte levelOffset,
             PolygonPoint lower, PolygonPoint upper)
     : this(handler, version,
            name, priority, areaTypeFlags, closedPolygon,
            allowIntersectionFlags, surfaceTypeFlags, surfaceAttributeFlags,
            levelOffset,
            0,
            lower, upper)
 {
     if (version >= 0x00000007)
     {
         throw new InvalidOperationException($"Constructor requires ElevationOffset for version {version}");
     }
 }
Example #3
0
            public Area(int APIversion, EventHandler handler, uint version,
                        uint name, byte priority, AreaType areaTypeFlags, IEnumerable <PolygonPoint> closedPolygon,
                        AllowIntersection allowIntersectionFlags, SurfaceType surfaceTypeFlags, SurfaceAttribute surfaceAttributeFlags,
                        byte levelOffset,
                        float elevationOffset,
                        PolygonPoint lower, PolygonPoint upper)
                : base(APIversion, handler)
            {
                this.ParentVersion = version;

                this.name                   = name;
                this.priority               = priority;
                this.areaTypeFlags          = areaTypeFlags;
                this.closedPolygon          = closedPolygon == null ? null : new PolygonPointList(handler, closedPolygon);
                this.allowIntersectionFlags = allowIntersectionFlags;
                this.surfaceTypeFlags       = surfaceTypeFlags;
                this.surfaceAttributeFlags  = surfaceAttributeFlags;
                this.levelOffset            = levelOffset;
                this.elevationOffset        = elevationOffset;
                this.lower                  = new PolygonPoint(APIversion, handler, lower);
                this.upper                  = new PolygonPoint(APIversion, handler, upper);
            }