public void Insert(int index, Vertices list)
 {
     // add them in reverse order to the list at the given index
     for (int i = list.Length; i >= 0; --i)
     {
         Insert(index, list[i]);
     }
 }
 public PolygonCollider(Vector2 position, Vertices vertices)
     : base(ColliderTypes.Polygon)
 {
     _position = position;
     _localvertices = vertices;
     _transformedvertices = (Vertices)_localvertices.Clone();
     SetBounds();
 }
 public PolygonCollider(Entity e, Vertices vertices)
     : base(ColliderTypes.Polygon)
 {
     _entity = e;
     _localvertices = vertices;
     _transformedvertices = (Vertices)_localvertices.Clone();
     SetBounds();
 }
 public void Transform(Vertices value)
 {
     _transformedvertices = value;
 }
 public Polygon(Vector2[] vertices)
 {
     _vertices = new Vertices(vertices);
     _transformedvertices = new Vertices(vertices);
 }
 /// <summary>
 /// Constructs a new VectorPolygon object from the given points.
 /// </summary>
 /// <param name="vertices">The raw set of points.</param>
 public Polygon(Vertices vertices)
 {
     _vertices = vertices;
     _transformedvertices = (Vertices)vertices.Clone();
 }
 public Shape(Vertices vertices)
 {
     _vertices = vertices;
 }
 public void AddPolygon(Vertices vertices, Color color)
 {
     for (int i = 0; i < _vertices.Length; i++)
     {
         if (i == 0) { AddVertex(vertices[vertices.Length - 1], color); }
         else { AddVertex(vertices[i - 1], color); }
         AddVertex(vertices[i], color);
     }
 }