Пример #1
0
        protected void StartNewGame(int gridSize)
        {
            Debug.WriteLine("Created gamefield");

            SweeperGame game = new SweeperGame();

            int minesCount = ListOfButtons.Count() / 3;

            if (rbEasy.Checked)
            {
                minesCount = ListOfButtons.Count() / 8;
            }
            else if (rbMedium.Checked)
            {
                minesCount = ListOfButtons.Count() / 4;
            }
            else if (rbHard.Checked)
            {
                minesCount = ListOfButtons.Count() / 2;
            }

            try
            {
                if (ListOfButtons != null)
                {
                    game.GenerateRandomMines(ListOfButtons, (minesCount));
                    Debug.WriteLine("Generated random");
                }
                else
                {
                    Debug.WriteLine("BUTTON IS NULL");
                }
            }
            catch (Exception ex) { Debug.WriteLine(ex.Message); }
        }
        protected void StartNewGame(int gridSize)
        {
            Debug.WriteLine("Created gamefield");

            SweeperGame game = new SweeperGame();

            int minesCount = ListOfButtons.Count() / 2;

            Debug.WriteLine("Mines count is: " + minesCount);

            try
            {
                if (ListOfButtons != null)
                {
                    game.GenerateRandomMines(ListOfButtons, (minesCount));
                    Debug.WriteLine("Generated random");
                }
                else
                {
                    Debug.WriteLine("BUTTON IS NULL");
                }
            }
            catch (Exception ex) { Debug.WriteLine(ex.Message); }
        }
        protected void StartNewGame(int gridSize)
        {
            Debug.WriteLine("Created gamefield");

            SweeperGame game = new SweeperGame();

            int minesCount = ListOfButtons.Count() / 3;

            if (rbEasy.Checked)
                minesCount = ListOfButtons.Count() / 8;
            else if (rbMedium.Checked)
                minesCount = ListOfButtons.Count() / 4;
            else if (rbHard.Checked)
                minesCount = ListOfButtons.Count() / 2;

            try
            {
                if (ListOfButtons != null)
                {
                    game.GenerateRandomMines(ListOfButtons, (minesCount));
                    Debug.WriteLine("Generated random");
                }
                else
                    Debug.WriteLine("BUTTON IS NULL");

            }
            catch (Exception ex) { Debug.WriteLine(ex.Message); }
        }
        protected void StartNewGame(int gridSize)
        {
            Debug.WriteLine("Created gamefield");

            SweeperGame game = new SweeperGame();

            int minesCount = ListOfButtons.Count() / 2;

            Debug.WriteLine("Mines count is: " + minesCount);

            try
            {
                if (ListOfButtons != null)
                {
                    game.GenerateRandomMines(ListOfButtons, (minesCount));
                    Debug.WriteLine("Generated random");
                }
                else
                    Debug.WriteLine("BUTTON IS NULL");

            }
            catch (Exception ex) { Debug.WriteLine(ex.Message); }
        }