protected static void AddPolygonObstacle(Vertices polygonVertices, bool isRectangle, ObstacleCollection obstacles, int layer) { if (isRectangle) { var rectangle = new RectangleObstacle(polygonVertices, layer); obstacles.Add(rectangle); } else { var polygonObstacle = new PolygonObstacle(polygonVertices, layer); obstacles.Add(polygonObstacle); } }
protected static void AddSlopeObstacle(Vertices polygonVertices, bool isRectangle, ObstacleCollection obstacles, int layer) { if (isRectangle) { var rectangle = new RectangleObstacle(polygonVertices, layer) {IsSlope = true}; obstacles.Add(rectangle); } else { var polygonObstacle = new PolygonObstacle(polygonVertices, layer) {IsSlope = true}; obstacles.Add(polygonObstacle); } }