예제 #1
0
        // Called when the under lying label is double clicked
        private void NumberDoubleClick(object sender, EventArgs e)
        {
            // Read the X and Y values
            Label lbl = sender as Label;
            int   x   = ((Tuple <int, int>)lbl.Tag).Item1;
            int   y   = ((Tuple <int, int>)lbl.Tag).Item2;

            if (!GameData.GetIsMine(x, y) && (GameData.GetFlaggedNearBy(x, y) == GameData.GetCellValue(x, y)))
            {
                UnHideTile(x + 1, y + 1);
                UnHideTile(x + 1, y);
                UnHideTile(x + 1, y - 1);
                UnHideTile(x, y + 1);
                UnHideTile(x, y - 1);
                UnHideTile(x - 1, y + 1);
                UnHideTile(x - 1, y);
                UnHideTile(x - 1, y - 1);

                GameData.TestGameOver();
            }
        }