//constructor public Plate(MinesGrid grid, int rowPosition, int colPosition) { this.GameGrid = grid; size = grid.Height; this.RowPosition = rowPosition; this.ColPosition = colPosition; }
private void GameSetup() { Mines = new MinesGrid(size, size, mines); foreach (Button btn in ButtonsGrid.Children) { btn.Content = ""; // clears flag or bomb image (if any) btn.IsEnabled = true; // button gets clickable } // Attaches Button Click, invoked by a plate Mines.ClickPlate += OnClickPlate; Mines.Run(); gameStarted = true; }