Ejemplo n.º 1
0
        public Game(Board board, TranspositionTable transpositionTable, Colour humanColour = Colour.None)
        {
            this.board = board;

            HumanColour = humanColour;
            CpuColour   = humanColour.Opposite();

            moveGenerator = new MoveGenerator(16);

            positionEvaluator = new PositionEvaluator();

            search = new Search(moveGenerator, positionEvaluator, transpositionTable);

            search.Info += _search_Info;

            var moves = new List <uint>();

            moveGenerator.Generate(board, Colour.White, moves);

            AvailableMoves = moves.Select(x => new MoveViewer(x));

            history.Push(new GameHistoryNode(board.History.First(), GetGameState()));
        }
Ejemplo n.º 2
0
 public Search(MoveGenerator moveGenerator, PositionEvaluator positionEvaluator, TranspositionTable transpositionTable)
 {
     this.moveGenerator      = moveGenerator;
     this.positionEvaluator  = positionEvaluator;
     this.transpositionTable = transpositionTable;
 }