private void GameSetup() { Mines = new MinesGrid(10, 10, nrMines); foreach (Button btn in ButtonsGrid.Children) { btn.Content = ""; btn.IsEnabled = true; } Mines.CounterChanged += OnCounterChanged; MinesIndicator.Text = nrMines.ToString(); Mines.ClickPlate += OnClickPlate; Mines.TimerThresholdReached += OnTimeChanged; TimeIndicator.Text = "0"; Mines.Run(); gameStarted = true; }
/// <summary> /// Ustawienia gry /// </summary> private void GameSetup() { Mines = new MinesGrid(10, 10, nrMines); foreach (Button btn in ButtonsGrid.Children) { btn.Content = ""; // clears flag or bomb image (if any) btn.IsEnabled = true; // button gets clickable } // Attaches Mines Indicator Event Mines.CounterChanged += OnCounterChanged; MinesIndicator.Text = nrMines.ToString(); // Attaches Button Click, invoked by a plate Mines.ClickPlate += OnClickPlate; // Attaches Time Threshold Elapsed Event Mines.TimerThresholdReached += OnTimeChanged; TimeIndicator.Text = "0"; Mines.Run(); gameStarted = true; }
private void GameSetup() { Mines = new MinesGrid(10, 10, nrMines); foreach (Button btn in ButtonsGrid.Children) { btn.Content = ""; // clears flag or bomb image (if any) btn.IsEnabled = true; // button gets clickable } // Attaches Mines Indicator Event Mines.CounterChanged += OnCounterChanged; MinesIndicator.Text = nrMines.ToString(); // Attaches Button Click, invoked by a plate Mines.ClickPlate += OnClickPlate; // Attaches Time Threshold Elapsed Event Mines.TimerThresholdReached += OnTimeChanged; TimeIndicator.Text = "0"; Mines.Run(); gameStarted = true; }
//constructor public Plate(MinesGrid grid, int rowPosition, int colPosition) { this.GameGrid = grid; this.RowPosition = rowPosition; this.ColPosition = colPosition; }
//konstruktor public Plate(MinesGrid grid, int rowPosition, int colPosition) { this.GameGrid = grid; this.RowPosition = rowPosition; this.ColPosition = colPosition; }