예제 #1
0
        public void Think(ViewInfo viewInfo, Board board)
        {
            if (GameFinished(board))
                hands.ClickToNewGame(viewInfo);

            hands.Click(viewInfo, rand.Next(viewInfo.BoardWidth), rand.Next(viewInfo.BoardHeight));
        }
예제 #2
0
        public void Log(Board board)
        {
            if (textbox == null)
                return;

            textbox.Document = new FlowDocument(new Paragraph(new Run(board.ToString())));
        }
예제 #3
0
 private static bool GameFinished(Board board)
 {
     for (var y = 0; y < board.Height; y++)
         for (var x = 0; x < board.Width; x++)
             if (board.Cells[x, y] == Cell.Mine)
                 return true;
     return false;
 }