Пример #1
0
        /// <summary>
        /// Sets the basic information about the cell. Much of the rest of the work is handled automatically.
        /// </summary>
        /// <param name="parentGrid"></param>
        /// <param name="gridLocation"></param>
        internal GridCell(GameGrid parentGrid, Coordinate gridLocation)
        {
            parent     = parentGrid;
            state      = cellState.normal;
            mined      = false;
            position   = gridLocation;
            cellButton = createButton();

            cellStateUpdate();
        }
Пример #2
0
        private void buttonNewGame_Click_1(object sender, EventArgs e)
        {
            if (gameBoard != null)
            {
                gameBoard.delete();
                panelPrimary.Controls.Remove(gameBoard.layoutGrid);
            }
            gameBoard             = new GameGrid(this, mineProbability, cellCountWidth, cellCountHeight);
            labelInformation.Text = "Minesweeper";

            timeElapsed = -1;
            timer1_Tick();
        }