private ITrapezoidalMap GenerateTrapezoidalMap(IEnumerable <SimplePolygon> obstacles) { var edges = from obstacle in obstacles from edge in obstacle.Edges select edge; var segments = from edge in edges select new Segment(edge.Origin.Position, edge.End.Position); TrapezoidalMap.TrapezoidalMap trapezoidalMap = new TrapezoidalMap.TrapezoidalMap(segments.ToList()); // must handle empty case return(trapezoidalMap); }
private ITrapezoidalMap GenerateTrapezoidalMap(IEnumerable<SimplePolygon> obstacles) { var edges = from obstacle in obstacles from edge in obstacle.Edges select edge; var segments = from edge in edges select new Segment(edge.Origin.Position, edge.End.Position); TrapezoidalMap.TrapezoidalMap trapezoidalMap = new TrapezoidalMap.TrapezoidalMap(segments.ToList()); // must handle empty case return trapezoidalMap; }