Exemple #1
0
        public BoardStateBase GetNewState(Cell cell)
        {
            var clonedState = Clone();

            BoardFactory.AddCellToLines(cell, clonedState);
            return(clonedState);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }