public void ResetSimulation() { lock (_lockObject) { var copyGenerator = new GameOfLifeCopyCellGenerator(_initialGrid); _grid = new Grid <GameOfLifeCellMetadata>(_initialGrid.Dimensions, copyGenerator); _grid2 = new Grid <GameOfLifeCellMetadata>(_initialGrid.Dimensions, copyGenerator); _grid.Regenerate(); _grid2.Regenerate(); _grid.CellGenerator = new GameOfLifeIterationCellGenerator(this, _grid2, _gridRenderer); _grid2.CellGenerator = new GameOfLifeIterationCellGenerator(this, _grid, _gridRenderer); _gridRenderer.StartSession(); _gridRenderer.RenderGrid(_initialGrid); } }
public void ResetSimulation() { lock (_lockObject) { var copyGenerator = new DayAndNightCopyCellGenerator(_initialGrid); _grid = new Grid <DayAndNightCellMetadata>(_initialGrid.Dimensions, copyGenerator); _grid2 = new Grid <DayAndNightCellMetadata>(_initialGrid.Dimensions, copyGenerator); _grid.Regenerate(); _grid2.Regenerate(); _grid.CellGenerator = new DayAndNightIterationCellGenerator(this, _grid2, _gridRenderer); _grid2.CellGenerator = new DayAndNightIterationCellGenerator(this, _grid, _gridRenderer); Console.Clear(); Console.CursorVisible = false; _gridRenderer.RenderGrid(_initialGrid); } }