using System.Collections.Generic;

using Spark3D.LightSources;
using Spark3D.Projector3D;

namespace Spark3D.Objects3D
{
    public class Object3DCommon : IObject3D
    {
        internal IList<Polygon3D> itsPolygons;
        protected Object3DCommon(IList<Polygon3D> polygons)
        {
            itsPolygons = polygons;
        }

        public IList<Polygon2D> Polygons(IProjector3D p3d)
        {
            return p3d.Project(itsPolygons);
        }

        public void Illuminate(ILightSource light)
        {
            light.Illuminate(itsPolygons);
        }


    }
}
