示例#1
0
        public void RevealAround(Mine mine, Button button)
        {
            int  y = Grid.GetColumn(button);
            int  x = Grid.GetRow(button);
            Mine getMine;

            if (x - 1 >= 0)
            {
                getMine = Game.GetPoint(x - 1, y);
                if (!getMine.explosive && !getMine.reaveled)
                {
                    RevealPoint(getMine, GetButton(x - 1, y));
                    //   GetButton(x - 1, y).Background = Brushes.MediumAquamarine;
                }
            }
            if (y - 1 >= 0)
            {
                getMine = Game.GetPoint(x, y - 1);
                if (!getMine.explosive && !getMine.reaveled)
                {
                    RevealPoint(getMine, GetButton(x, y - 1));
                    //   GetButton(x, y - 1).Background = Brushes.MediumAquamarine;
                }
            }
            if (y + 1 <= sizeY - 1)
            {
                getMine = Game.GetPoint(x, y + 1);
                if (!getMine.explosive && !getMine.reaveled)
                {
                    RevealPoint(getMine, GetButton(x, y + 1));
                    //  GetButton(x, y + 1).Background = Brushes.MediumAquamarine;
                }
            }
            if (x + 1 <= sizeX - 1)
            {
                getMine = Game.GetPoint(x + 1, y);
                if (!getMine.explosive && !getMine.reaveled)
                {
                    RevealPoint(getMine, GetButton(x + 1, y));
                    // GetButton(x + 1, y).Background = Brushes.MediumAquamarine;
                }
            }
        }