using System.Drawing;

namespace Spark3D.Objects3D
{
    public class Polygon2D
    {
        public Point[] itsVerticies;
        public Color itsColour;
        public double itsZ; //Distance form the viewing plane.

        public Polygon2D(Point[] vs, Color c, double z)
        {
            itsVerticies = vs;
            itsColour = c;
            itsZ = z;
        }

        public void Shift(Point delta)
        {
            // C# won't let us modify the container in a foreach loop so we need to loop
            // with an index.
            for (int i = 0; i < itsVerticies.Length; i++)
            {
                Point p = itsVerticies[i];
                itsVerticies[i] = new Point(p.X + delta.X, p.Y + delta.Y);
            }
        }
    }
}
