예제 #1
0
 private void Game_OnActive(object sender, FlagEventArgs e)
 {
     if (sender is Mine)
     {
         if (((Mine)sender).ActiveStatus)
         {
             gameArea.Enabled = false;
             ShowAllMines();
             Thread thread = new Thread(ExplosiveAllMines);
             thread.Start();
         }
     }
     if (flagCount == countOfMines)
     {
         if (IsAllCellActiveOrFlag() && IsFlagCoordinateEqualsMinesCoordinate())
         {
             MessageBox.Show("Сегодня ты выжил!!!");
         }
     }
 }
예제 #2
0
 private void Game_OnFlagChange(object sender, FlagEventArgs e)
 {
     flagCount          = e.value ? ++flagCount : --flagCount;
     flagIndicator.Text = $"Кол-во доступных флажков: {countOfMines - flagCount}";
 }