public void Continue() { cells = new Cell[Width, Height]; for (var i = 0; i < Width; i++) { for (var j = 0; j < Height; j++) { cells.SetValue(new Cell() { X = i, Y = j, IsBomb = false }, i, j); } } State = GameState.GameStart; }
// Populating the 2-d array of Cells // Subscribing to the SpreadsheetCell's PropertyChanged event public Spreadsheet(int rows, int columns) { this.array = new Cell[rows, columns]; this.Rows = rows; this.Columns = columns; for (int i = 0; i < Rows; i++) { for (int j = 0; j < Columns; j++) { Cell newCell = new Cell(i, j); newCell.PropertyChanged += OnCellPropertyChanged; array.SetValue(newCell, i, j); } } }