Example #1
0
        public MainForm()
        {
            InitializeComponent();

            graph = PictureBox_Main.CreateGraphics();

            ResetUICounters();

            updateTimer          = new Timer();
            updateTimer.Interval = 100;
            updateTimer.Tick    += TimerUpdate;
            updateTimer.Start();
        }
Example #2
0
 public void StartNewSimulation(Simulation simulation)
 {
     this.simulation?.SafeStop();
     this.simulation              = simulation;
     graph                        = PictureBox_Main.CreateGraphics();
     drawer                       = new Drawer(graph, graph.VisibleClipBounds, simulation);
     simulation.Updated          += drawer.Draw;
     simulation.CellStateChanged += drawer.RedrawPosition;
     UpdateChildControlsWithNewOptions(simulation.GetCurrentOptions());
     drawer.RedrawAllPositions();
     ResetUICounters();
     simulation.Simulate();
     Pause();
 }
Example #3
0
 void ClearScreen()
 {
     PictureBox_Main.CreateGraphics().Clear(System.Drawing.Color.Black);
 }
Example #4
0
 private void MainForm_ResizeEnd(object sender, EventArgs e)
 {
     graph = PictureBox_Main.CreateGraphics();
     drawer?.UpdateGraphicsNextFrame(graph, graph.VisibleClipBounds);
     drawer?.RedrawAllPositions();
 }