コード例 #1
0
 public PolygonObstacle(IEnumerable<PointF> Points,Brush pDrawBrush,Pen pDrawPen)
     : base(CenterPoint(Points),null,0)
 {
     _DrawMethod = new FilledPolyDrawMethod(pDrawPen, pDrawBrush);
     _Poly = new Polygon(Points.ToArray());
     //base.Size = _Poly.GetBounds().Size;
 }
コード例 #2
0
 /// <summary>
 /// Generates an Obstacle at the given location with a random number of points created using a random radius.
 /// </summary>
 /// <param name="pLocation"></param>
 /// <param name="MinPoints"></param>
 /// <param name="MaxPoints"></param>
 /// <param name="MinRadius"></param>
 /// <param name="MaxRadius"></param>
 /// <param name="pDrawBrush"></param>
 /// <param name="pDrawPen"></param>
 public PolygonObstacle(PointF pLocation,int MinPoints,int MaxPoints,float MinRadius,float MaxRadius,PolygonBlockDrawMethod drawMethod)
     : base(pLocation,null,0)
 {
     _Location = pLocation;
     _Poly = new Polygon(BCBlockGameState.GenPoly(MinRadius,MaxRadius,MinPoints,MaxPoints));
     _Poly.Offset(pLocation);
     _DrawMethod = drawMethod;
     //base.Size = _Poly.GetBounds().Size;
 }
コード例 #3
0
 public PolygonObstacle(PointF pLocation,int NumPoints,float MinRadius,float MaxRadius,
                        PolygonBlockDrawMethod drawMethod)
     : this(pLocation,NumPoints,NumPoints,MinRadius,MaxRadius,drawMethod)
 {
 }