using System.Text; using Shapes; using Shapes.Shapes; using SimpleDrawing; using SimpleDrawing.Core; Console.OutputEncoding = Encoding.UTF8; const int Size = 600; var shapes = new List(); var generator = new ShapeGenerator(Size, Size); LeoCanvas.Init(Run, Size, Size, clickAction: HandleClick, windowTitle: "Shapes"); return; void Run() { try { // initial rendering Redraw(); Console.WriteLine("Press any key to exit..."); Console.ReadKey(); } catch (Exception ex) { Console.WriteLine($"An error occurred: {ex.Message}"); } } void HandleClick(ClickEvent @event) { // TODO - handle click at location Redraw(); } void Redraw() { LeoCanvas.Clear(); foreach (var shape in shapes) { if (!shape.DrawSelf()) { Console.WriteLine($"Couldn't draw shape with id {shape.Id} 😭"); } } LeoCanvas.Render(); }