using System.Collections.Generic;
using Polygons.Library;
using System;

namespace Polygons
{
    class Program
    {
        static void Main(string[] args)
        {
            var listeShape = new List<IRegularPolygon>();
            listeShape.Add(new Square(1)); ;
            listeShape.Add(new Triangle(1));
            //liste.Add(new IRegularPolygon(5));  KO pas possible
            foreach (IRegularPolygon shape in listeShape)
            {
                DisplayPolygon(shape);
            }
            Console.ReadKey();
        }

        public static void DisplayPolygon(IRegularPolygon polygon)
        {

            Console.WriteLine("Number of Sides:{0}", polygon.NumberOfSides);
            Console.WriteLine("Side Length:{0}", polygon.SideLength);
            Console.WriteLine("Perimeter:{0}", polygon.GetPerimeter());
            Console.WriteLine("Area:{0}", Math.Round(polygon.GetArea(), 2));
            Console.WriteLine();
        }

    }
}
