예제 #1
0
        public List <MoveScenarios> getAllowPlayerMoves(Board board)
        {
            if (currMoveScenarios == null)
            {
                return(moveFinder.getAllowMoveScenarios(board, board.PlayerColor));
            }

            List <MoveScenarios> list = new List <MoveScenarios>();

            list.Add(currMoveScenarios);

            return(list);
        }
예제 #2
0
        public bool addChildBoardStates(MoveFinder moveFinder)
        {
            List <MoveScenarios> allScenarios = moveFinder.getAllowMoveScenarios(BoardState, BoardState.CurrentColor);

            foreach (MoveScenarios currScenario in allScenarios)
            {
                for (int i = 0; i < currScenario.Count(); i++)
                {
                    Board newBoardState = new Board(BoardState);
                    MoveController.execScenario(newBoardState, currScenario, i);

                    ChildsContext.Push(
                        new MoveContext(
                            newBoardState,
                            currScenario.getFromPosition(),
                            currScenario.getScenario(i),
                            CurrDepth + 1,
                            this,
                            !IsMax
                            )
                        );
                }
            }

            IsVisited = true;

            if (allScenarios.Count > 0)
            {
                return(allScenarios[0].isCapture());
            }

            return(false);
        }