Example #1
0
        public static Grid newGrid(string difficulty, Minesweeper _parent)
        {
            Grid g;

            if (difficulty.Equals("easy"))
            {
                g = new Grid(10, 8, 10, EasyWidth, _parent.Width / 2 - EasyWidth / 2, 100, _parent);
            }
            else if (difficulty.Equals("medium"))
            {
                g = new Grid(18, 14, 40, MedWidth, _parent.Width / 2 - MedWidth / 2, 100, _parent);
            }
            else if (difficulty.Equals("hard"))
            {
                g = new Grid(24, 20, 99, HardWidth, _parent.Width / 2 - HardWidth / 2, 100, _parent);
            }
            else
            {
                throw new InvalidOperationException();
            }

            _parent.UpdateFlagCounter(g.GetMineCount());
            return(g);
        }
Example #2
0
 public void UpdateFlagCounter()
 {
     parent.UpdateFlagCounter(RemainingFlags);
 }