示例#1
0
 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);
     }
 }
示例#2
0
 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);
     }
 }