Esempio n. 1
0
        public void SetupBoard()
        {
            for (var i = 1; i <= Width; i++)
            {
                for (var i1 = 1; i1 <= Height; i1++)
                {
                    var c = new Cell
                    {
                        XLoc      = i - 1,
                        YLoc      = i1 - 1,
                        CellState = 1,
                        CellType  = 0,
                        CellSize  = 50,
                        Board     = this
                    };
                    c.SetupDesign();

                    c.MouseDown += Cell_MouseClick;

                    this.Cells[i - 1, i1 - 1] = c;

                    this.Minesweeper.Controls.Add(c);
                }
            }
        }
Esempio n. 2
0
        public void SetupBoard()
        {
            var c = new Cell
            {
                CellState = CellState.Closed,
                CellType  = CellType.Regular,
                CellSize  = 50,
                Board     = this
            };

            c.SetupDesign();
            c.MouseDown += Cell_MouseClick;

            this.Cells[0, 0] = c;
            this.Minesweeper.Controls.Add(c);
        }
Esempio n. 3
0
        public void SetupBoard()
        {
            for (var i = 0; i < Width; i++)
            {
                for (var j = 0; j < Height; j++)
                {
                    var c = new Cell
                    {
                        XLoc      = i,
                        YLoc      = j,
                        CellState = CellState.Closed,
                        CellType  = CellType.Regular,
                        CellSize  = 50,
                        Board     = this
                    };
                    c.SetupDesign();
                    c.MouseDown += Cell_MouseClick;

                    this.Cells[i, j] = c;
                    this.Minesweeper.Controls.Add(c);
                }
            }
        }