public static List <Shapes> GenerateSomeShapesInList() { Shapes triangle = new Triangle(3, 4); Shapes square = new Square(2); Square squareAnother = new Square(3, 3); //Shapes squareVariant2 = new Square(2, 4); //raises an exception when created as values are diff Shapes rectangle = new Rectagle(3, 4); List <Shapes> shapesList = new List <Shapes> { triangle, rectangle, square, squareAnother }; return(shapesList); }
// Every .cs its a different program public static void Main(string[] args) { Trangle t = new Trangle(); Rectagle r = new Rectagle(); //BaseForm t.Height = 1; t.New(); r.Base = 1; r.New(); t.Values(); r.Values(); //Changes t.Base = 10; r.Height = 10; //Results t.Values(); r.Values(); Console.ReadKey(); }