示例#1
0
 private void LeftClick(object sender, RoutedEventArgs e)
 {
     if (!Game.GameOver || Game.GameWon)
     {
         Button button = (Button)e.Source;
         int    y      = Grid.GetColumn(button);
         int    x      = Grid.GetRow(button);
         if (!Game.generated)
         {
             Game.GenerateMineField(x, y);
             RevealAround(Game.MineField[x][y], button);
         }
         // button.Background = Brushes.Yellow;
         //  Debug.WriteLine(x + " " + y);
         Game.DebugMineField(x, y);
         RevealPoint(Game.MineField[x][y], button);
         Game.isGameWon();
     }
     if (Game.GameWon)
     {
         GameWonLabel.Visibility = Visibility.Visible;
     }
 }