public long ParseEdges(BSP bsp, BinaryReader reader, int count)
        {
            bsp.Edges = new List <BSP.Edge>();
            var originalPos = reader.BaseStream.Position;

            for (uint i = 0; i < count; ++i)
            {
                reader.BaseStream.Position = originalPos + (i * EDGE_SIZE);
                var start_vert_idx    = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);
                var end_vert_idx      = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);
                var forward_edge_idx  = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);
                var reverse_edge_idx  = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);
                var left_surface_idx  = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);
                var right_surface_idx = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);

                var edge = new BSP.Edge();

                edge.StartVertex  = (short)start_vert_idx;
                edge.EndVertex    = (short)end_vert_idx;
                edge.ForwardEdge  = (short)forward_edge_idx;
                edge.ReverseEdge  = (short)reverse_edge_idx;
                edge.LeftSurface  = (short)left_surface_idx;
                edge.RightSurface = (short)right_surface_idx;

                bsp.Edges.Add(edge);
            }

            return(originalPos + (count * EDGE_SIZE));
        }
        public long ParseEdges(BSP bsp, BinaryReader reader, int count)
        {
            bsp.Edges = new List<BSP.Edge>();
            var originalPos = reader.BaseStream.Position;

            for (uint i = 0; i < count; ++i)
            {
                reader.BaseStream.Position = originalPos + (i * EDGE_SIZE);
                var start_vert_idx = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);
                var end_vert_idx = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);
                var forward_edge_idx = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);
                var reverse_edge_idx = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);
                var left_surface_idx = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);
                var right_surface_idx = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);

                var edge = new BSP.Edge();

                edge.StartVertex = (short)start_vert_idx;
                edge.EndVertex = (short)end_vert_idx;
                edge.ForwardEdge = (short)forward_edge_idx;
                edge.ReverseEdge = (short)reverse_edge_idx;
                edge.LeftSurface = (short)left_surface_idx;
                edge.RightSurface = (short)right_surface_idx;

                bsp.Edges.Add(edge);
            }

            return originalPos + (count * EDGE_SIZE);
        }