예제 #1
0
        public IBoard LeftClick(int x, int y)
        {
            x--;
            y--;
            var tile = Board.GetTile(x, y);

            if (tile.IsFlag)
            {
                return(Board);
            }
            Board.RevealTile(x, y);
            if (tile.IsBomb)
            {
                GameStatus = GameStatus.Lose;
            }
            return(Board);
        }
예제 #2
0
        public IBoard RightClick(int x, int y)
        {
            x--;
            y--;
            if (!Board.IsValidPosition(x, y))
            {
                return(Board);
            }

            var tile = Board.GetTile(x, y);

            if (!tile.IsRevealed)
            {
                Board.ChangeFlag(x, y);
            }

            if (AreAllBombsFlagged())
            {
                GameStatus = GameStatus.Win;
            }

            return(Board);
        }