private void paintGrid1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var point = new GameOfLife.Core.Models.Point {
                X = paintGrid1.CurrentCell.RowIndex, Y = paintGrid1.CurrentCell.ColumnIndex
            };
            var state = _gameOfLife.ToggleState(point);

            _animation.repaint();
        }
Beispiel #2
0
 public void SetCellColor(GameOfLife.Core.Models.Point point, CellState state)
 {
     if (state == CellState.ALIVE || state == CellState.SPAWNING)
     {
         _grid.Rows[point.X].Cells[point.Y].Style.BackColor = Color.Red;
     }
     else
     {
         _grid.Rows[point.X].Cells[point.Y].Style.BackColor = Color.White;
     }
 }
Beispiel #3
0
 public void repaint()
 {
     for (int x = 0; x < _gameOfLife.GridSize.X; x++)
     {
         for (int y = 0; y < _gameOfLife.GridSize.Y; y++)
         {
             var point = new GameOfLife.Core.Models.Point {
                 X = x, Y = y
             };
             var state = _gameOfLife.GetState(point);
             SetCellColor(point, state);
         }
     }
 }