public void Think(ViewInfo viewInfo, Board board) { if (GameFinished(board)) hands.ClickToNewGame(viewInfo); hands.Click(viewInfo, rand.Next(viewInfo.BoardWidth), rand.Next(viewInfo.BoardHeight)); }
public void Log(Board board) { if (textbox == null) return; textbox.Document = new FlowDocument(new Paragraph(new Run(board.ToString()))); }
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; }