protected List <Line> GetLines(string fileName) { var board = BoardExportImport.Import(Path.Combine(Folder, fileName)); var game = new Game(board); return(game.GetLines(board.WhoMovedLast())); }
private static int TestEstimation(string fileName) { var board = BoardExportImport.Import(Path.Combine(folder, fileName)); var game = new Game(board); return(GetEstimate(game, board.WhoMovedLast())); }
public static Game TestMove(string folderPath, string boardName, int depth, params Cell[] correctMoves) { var board = BoardExportImport.Import(Path.Combine(folderPath, boardName)); var game = new Game(board); var move = game.DoMove(board.WhoMovesNext(), depth, Game.DefaultWidth); Assert.IsTrue(correctMoves.Any(cm => cm == move)); return(game); }
private static NextCells GetNextCells(string fileName, bool next = false) { var board = BoardExportImport.Import(Path.Combine(folder, fileName)); var game = new Game(board); var owner = next ? board.WhoMovesNext() : board.WhoMovedLast(); var state = game.GetBoardState(owner, Game.DefaultDepth, Game.DefaultWidth); return(state.GetNextCells()); }
private void ExportBoardBtnClick(object sender, EventArgs e) { if (exportBoardFileDialog.ShowDialog() != DialogResult.OK) { return; } BoardExportImport.Export(currentBoard.Board, exportBoardFileDialog.FileName); }
private static List <Line> GetLines(string fileName, Cell cell) { var board = BoardExportImport.Import(Path.Combine(folder, fileName)); var game = new Game(board); var owner = board.WhoMovedLast(); var lines = game.GetLines(owner); board[cell.X, cell.Y] = owner.Opponent(); BoardFactory.AddCellToLines(cell, new BoardStateBase(new List <Line>(), lines, owner.Opponent(), board)); return(lines); }
private static List <Line> GetChangedLines(string fileName, Cell cell, bool movesInOrder = false) { var board = BoardExportImport.Import(Path.Combine(folder, fileName)); var game = new Game(board); var owner = movesInOrder ? board.WhoMovesNext() : board.WhoMovedLast(); var lines = game.GetLines(owner); board[cell.X, cell.Y] = owner; BoardFactory.AddCellToLines(cell, new BoardStateBase(lines, new List <Line>(), owner, board)); return(lines); }
private void ImportBoardBtnClick(object sender, EventArgs e) { if (importBoardFileDialog.ShowDialog() != DialogResult.OK) { return; } var board = BoardExportImport.Import(importBoardFileDialog.FileName); UpdateGrid(new EstimatedBoard { Board = board }); }