コード例 #1
0
        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;
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
ファイル: Plate.cs プロジェクト: psotirov/Minesweeper
 //constructor
 public Plate(MinesGrid grid, int rowPosition, int colPosition)
 {
     this.GameGrid = grid;
     this.RowPosition = rowPosition;
     this.ColPosition = colPosition;
 }
コード例 #5
0
ファイル: Plate.cs プロジェクト: IKOMMM/Supper_Sapper_WPF
 //konstruktor
 public Plate(MinesGrid grid, int rowPosition, int colPosition)
 {
     this.GameGrid    = grid;
     this.RowPosition = rowPosition;
     this.ColPosition = colPosition;
 }