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

namespace Polygons
{
    class Program
    {
        static void Main(string[] args)
        {
            var listeShape = new List<AbstractRegularPolygon>();
            listeShape.Add(new Square(1,"titi")); 
            listeShape.Add(new Triangle(2,"toto"));
            listeShape.Add(new Triangle(1, "riri"));
            listeShape.Add(new Square(4,"fifi")); 
            //////////////////////////////////////////////

            foreach (AbstractRegularPolygon shape in listeShape)
            {
                DisplayPolygon(shape);
            }
             //////////////////////////////////////////////
            Console.ReadKey();
        }

        public static void DisplayPolygon(AbstractRegularPolygon polygon)
        {
            Console.WriteLine("Name:{0}",polygon.Name);
            Console.WriteLine("I am a :{0}", polygon.GetType());
            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();
        }

    }
}
