static void Main(string[] args) { var shapes = new List<Shape>(); shapes.Add(new Circle { Width = 100, Height = 100, Position = new Position { X = 50, Y = 50 } }); shapes.Add(new Rectangle { Width = 100, Height = 50, Position = new Position { X = 100, Y = 100 } }); var canvas = new Canvas(); canvas.DrawShapes(shapes); }
static void Main(string[] args) { var shapes = new List<Shape>(); shapes.Add(new Circle()); shapes.Add(new Rectangle()); var canvas = new Canvas(); canvas.DrawShapes(shapes); }
static void Main(string[] args) { var lstShapes = new List<Shape>(); lstShapes.Add(new Circle()); // lstShapes.Add(new Triangle { Widht = 5, Height = 10 }); lstShapes.Add(new Rectangle { Widht = 5, Height = 15 }); var canvas = new Canvas(); canvas.DrawShape(lstShapes); }
static void Main(string[] args) { var shapes = new List<Shape>(); //shapes.Add(new Shape { Width = 100, Height = 100, Type = ShapeType.Square}); //shapes.Add(new Shape { Width = 100, Height = 30, Type = ShapeType.Hexagon}); shapes.Add(new Circle()); shapes.Add(new Hexagon()); var canvas = new Canvas(); canvas.DrawShapes(shapes); }