Beispiel #1
0
        public PlayerBoard(PlayerPosition playerPosition, Color playerColor, MovesArrayAllocator arrayAllocator)
        {
            this.position = playerPosition;
            this.color = playerColor;
            this.allocator = arrayAllocator;

            this.ResetAll();
        }
Beispiel #2
0
        public GameProvider(MovesArrayAllocator arrayAllocator)
        {
            this.allocator = arrayAllocator;
            this.PlayerBoard1 = new PlayerBoard(PlayerPosition.Down, Color.White, arrayAllocator);
            this.PlayerBoard2 = new PlayerBoard(PlayerPosition.Up, Color.Black, arrayAllocator);

            this.History = new MovesHistory();

            this.playerBoards = new PlayerBoard[2];
            this.playerBoards[(int)Color.White] = this.PlayerBoard1;
            this.playerBoards[(int)Color.Black] = this.PlayerBoard2;
        }
Beispiel #3
0
        public Move SolveProblem(GameProvider provider, Color color, int maxdepth)
        {
            Move bestMove;

            if (this.TryFindDebutMove(out bestMove))
            {
                return(bestMove);
            }

            this.gameProvider  = provider;
            this.ply           = 0;
            this.nodesSearched = 0;
            this.allocator     = provider.Allocator;
            this.AlphaBetaMain(maxdepth, color);
            return(this.bestMove);
        }