Beispiel #1
0
        public ChessMoveInfo Check(Square[,] board, Knight from, ChessFigure to)
        {
            if (Check_for_color_match(from, to))
            {
                return(new ChessMoveInfo(false));
            }

            bool KingIsInDanger = Check_for_check(from.IsWhite, board);             // If my King is in danger this move should save it;

            if (KingIsInDanger)
            {
                if (Check_if_king_is_check_after(board, from, to))
                {
                    // We don't care if the move is valid as long as it saves the king.
                    // After that initial check, it is asserted whether the move is valid or not
                    // and the necessary measures are taken.
                    return(new ChessMoveInfo(false));
                }
            }
            if (Check_if_king_is_check_after(board, from, to))
            {
                //Same idea but this time we check if the move puts
                //the life of our dear king in danger.
                return(new ChessMoveInfo(false));
            }

            ///Again we don't care if it's a valid move just yet,
            ///just checking if the figure were to move to the designated
            ///position will it endanger the enemy king or not.
            bool IsEnemyKingCheck = Check_for_check(!from.IsWhite, board, Generate_attack_board(board, new Knight(to.Row, to.Col, from.IsWhite, "")));

            ChessMoveInfo MoveInfo = new ChessMoveInfo(true, from.IsWhite);

            MoveInfo.FromRow = from.Row;
            MoveInfo.FromCol = from.Col;
            MoveInfo.ToRow   = to.Row;
            MoveInfo.ToCol   = to.Col;

            if (to.Name != "Empty")
            {
                MoveInfo.TakenFigureRow = to.Row;
                MoveInfo.TakenFigureCol = to.Col;
            }

            if (Math.Abs(from.Row - to.Row) == 2)
            {
                if (Math.Abs(from.Col - to.Col) == 1)
                {
                    return(MoveInfo);
                }
            }
            if (Math.Abs(from.Row - to.Row) == 1)
            {
                if (Math.Abs(from.Col - to.Col) == 2)
                {
                    return(MoveInfo);
                }
            }
            return(new ChessMoveInfo(false));
        }
        public async void DropFigure(ChessFigure figure)
        {
            string currentMove =
                parserService.CastPosition(
                    selectedFigure.Row, selectedFigure.Col,
                    figure.Row, figure.Col);

            DragFigureLeave(figure);

            dynamic dynamicFigure = selectedFigure;

            ChessMoveInfo moveInfo = rulesService.Check(board, dynamicFigure, figure);

            if (GameService.ProcessMove(board, moveInfo))
            {
                if (autoplay)
                {
                    await Autoplay(currentMove);
                }
                Tuple <int, int, int, int> engineMove = parserService.ParseString(await engineService.PlayMove(currentMove));
                dynamic fromFigure = board[engineMove.Item1, engineMove.Item2].Figure;
                dynamic toFigure   = board[engineMove.Item3, engineMove.Item4].Figure;

                moveInfo = rulesService.Check(board, fromFigure, toFigure);
                GameService.ProcessMove(board, moveInfo);
            }
        }
        private static List <ChessMoveInfo> AddReplacementMoveStepsIfNecessary(ChessMoveInfo pawnMove)
        {
            var result = new List <ChessMoveInfo>();

            var moveStep        = pawnMove.MoveSteps.First();
            var pawnToMove      = moveStep.PieceToMove;
            var moveDestination = moveStep.NewPosition;

            var potentialNewVerticalPosition = moveDestination.VerticalPosition;

            if (potentialNewVerticalPosition == PieceVerticalPosition.P_1 || potentialNewVerticalPosition == PieceVerticalPosition.P_8)
            {
                var player = pawnToMove.Player;
                var queenReplacementPiece  = player == Player.First ? Piece.WhiteQueen : Piece.BlackQueen;
                var rookReplacementPiece   = player == Player.First ? Piece.WhiteRook : Piece.BlackRook;
                var bishopReplacementPiece = player == Player.First ? Piece.WhiteBishop : Piece.BlackBishop;
                var knightReplacementPiece = player == Player.First ? Piece.WhiteKnight : Piece.BlackKnight;

                result.AddRange(new ChessMoveInfo[]
                {
                    pawnMove.WithExtraStep(new ChessMoveStepInfo(moveDestination, moveDestination, queenReplacementPiece.WithPosition(moveDestination))),
                    pawnMove.WithExtraStep(new ChessMoveStepInfo(moveDestination, moveDestination, rookReplacementPiece.WithPosition(moveDestination))),
                    pawnMove.WithExtraStep(new ChessMoveStepInfo(moveDestination, moveDestination, bishopReplacementPiece.WithPosition(moveDestination))),
                    pawnMove.WithExtraStep(new ChessMoveStepInfo(moveDestination, moveDestination, knightReplacementPiece.WithPosition(moveDestination))),
                });
            }
            else
            {
                result.Add(pawnMove);
            }

            return(result);
        }
Beispiel #4
0
 private ChessMoveItem(ChessMoveInfo move, Player humanPlayer)
 {
     PlayerName       = move.Player == humanPlayer ? "You:" : "Machine:";
     ShortDescription = ""; // TODO Proper chess notation?
     LongDescription  = move.ToString();
     Move             = move;
 }
        public void DragFigureEnter(ChessFigure figure)
        {
            dynamic       dynamicFigure = selectedFigure;
            ChessMoveInfo MoveInfo      = rulesService.Check(board, dynamicFigure, figure);

            if (MoveInfo)
            {
                board[figure.Row, figure.Col].CursorOver = true;
            }
        }
        private static List <ChessMoveInfo> GetCastlingMoves(ChessBoard board, Piece kingPiece)
        {
            var moves = new List <ChessMoveInfo>();

            var verticalPosition = kingPiece.Position.VerticalPosition;

            var shortCastlingRookPosition = new PiecePosition(PieceHorizontalPosition.P_H, verticalPosition);
            var shortCastlingRookPiece    = board.GetPiece(shortCastlingRookPosition);
            var canDoShortCastling        = CanDoCastling(board, kingPiece, shortCastlingRookPiece);

            if (canDoShortCastling)
            {
                var newRookPosition = new PiecePosition(PieceHorizontalPosition.P_F, verticalPosition);
                var newKingPosition = new PiecePosition(PieceHorizontalPosition.P_G, verticalPosition);
                var firstMoveStep   = new ChessMoveStepInfo(shortCastlingRookPosition, newRookPosition, shortCastlingRookPiece);
                var secondMoveStep  = new ChessMoveStepInfo(kingPiece.Position, newKingPosition, kingPiece);
                var steps           = new List <ChessMoveStepInfo> {
                    firstMoveStep, secondMoveStep
                };
                var move = new ChessMoveInfo(kingPiece.Player, steps, false, isCastling: true);
                moves.Add(move);
            }

            var longCastlingRookPosition = new PiecePosition(PieceHorizontalPosition.P_A, verticalPosition);
            var longCastlingRookPiece    = board.GetPiece(longCastlingRookPosition);
            var canDoLongCastling        = CanDoCastling(board, kingPiece, longCastlingRookPiece);

            if (canDoLongCastling)
            {
                var newRookPosition = new PiecePosition(PieceHorizontalPosition.P_D, verticalPosition);
                var newKingPosition = new PiecePosition(PieceHorizontalPosition.P_C, verticalPosition);
                var firstMoveStep   = new ChessMoveStepInfo(longCastlingRookPosition, newRookPosition, longCastlingRookPiece);
                var secondMoveStep  = new ChessMoveStepInfo(kingPiece.Position, newKingPosition, kingPiece);
                var steps           = new List <ChessMoveStepInfo> {
                    firstMoveStep, secondMoveStep
                };
                var move = new ChessMoveInfo(kingPiece.Player, steps, false, isCastling: true);
                moves.Add(move);
            }

            return(moves);
        }
        public bool ProcessMove(Square[,] Board, ChessMoveInfo MoveInfo)
        {
            if (!MoveInfo.IsAllowed)
            {
                return(false);
            }

            FiftyMoveCounter++;

            Square from = Board[MoveInfo.FromRow, MoveInfo.FromCol];
            Square to   = Board[MoveInfo.ToRow, MoveInfo.ToCol];

            // Check if pawn was moved
            if (from.Figure.Name == "Pawn")
            {
                FiftyMoveCounter = 0;
            }

            // Change to.figure to from.figure
            to.Figure     = from.Figure;
            to.Figure.Col = to.Col;
            to.Figure.Row = to.Row;

            if (to.Figure.Name == "King")
            {
                (to.Figure as King).HasMoved = true;
            }
            if (to.Figure.Name == "Rook")
            {
                (to.Figure as Rook).HasMoved = true;
            }

            // Change from to empty
            from.Figure = new Empty(from.Row, from.Col);

            //Check if a capture was made and if move was en passant
            if (MoveInfo.TakenFigureCol != Constants.OffBoard && MoveInfo.TakenFigureRow != Constants.OffBoard)
            {
                FiftyMoveCounter = 0;
                if (MoveInfo.TakenFigureCol != MoveInfo.ToCol || MoveInfo.TakenFigureRow != MoveInfo.ToRow)
                {
                    Board[MoveInfo.TakenFigureRow, MoveInfo.TakenFigureCol].Figure =
                        new Empty(MoveInfo.TakenFigureRow, MoveInfo.TakenFigureCol);
                }
            }

            //Check if move was Castle
            if (MoveInfo.WasKingSideCastle)
            {
                if (to.Figure.IsWhite)                 // Move rook to 7,5
                {
                    Board[7, 5].Figure     = Board[7, 7].Figure;
                    Board[7, 5].Figure.Row = 7;
                    Board[7, 5].Figure.Col = 5;

                    Board[7, 7].Figure = new Empty(7, 7);
                }
                if (!to.Figure.IsWhite)                 // Move rook to 0,5
                {
                    Board[0, 5].Figure     = Board[0, 7].Figure;
                    Board[0, 5].Figure.Row = 0;
                    Board[0, 5].Figure.Col = 5;

                    Board[0, 7].Figure = new Empty(0, 7);
                }
            }
            if (MoveInfo.WasQueenSideCastle)
            {
                if (to.Figure.IsWhite)
                {
                    Board[7, 3].Figure     = Board[7, 0].Figure;
                    Board[7, 3].Figure.Row = 7;
                    Board[7, 3].Figure.Col = 3;

                    Board[7, 0].Figure = new Empty(7, 0);
                }
                else
                {
                    Board[0, 3].Figure     = Board[0, 0].Figure;
                    Board[0, 3].Figure.Row = 0;
                    Board[0, 3].Figure.Col = 3;

                    Board[0, 0].Figure = new Empty(0, 0);
                }
            }

            //Check if move was Pawn 2MoveAhead
            if (MoveInfo.EnPasRow != Constants.OffBoard && MoveInfo.EnPasCol != Constants.OffBoard)
            {
                Board[MoveInfo.EnPasRow, MoveInfo.EnPasCol].EnPasPossible = true;
                Board[MoveInfo.EnPasRow, MoveInfo.EnPasCol].EnPasIsWhite  = !to.Figure.IsWhite;
            }

            return(true);
        }
Beispiel #8
0
        public ChessMoveInfo Check(Square[,] board, Queen from, ChessFigure to)
        {
            if (Check_for_color_match(from, to))
            {
                return(new ChessMoveInfo(false));
            }
            bool KingIsInDanger = Check_for_check(from.IsWhite, board);             // If my King is in danger this move should save it;

            if (KingIsInDanger)
            {
                if (Check_if_king_is_check_after(board, from, to))
                {
                    // We don't care if the move is valid as long as it saves the king.
                    // After that initial check, it is asserted whether the move is valid or not
                    // and the necessary measures are taken.
                    return(new ChessMoveInfo(false));
                }
            }
            if (Check_if_king_is_check_after(board, from, to))
            {
                //Same idea but this time we check if the move puts
                //the life of our dear king in danger.
                return(new ChessMoveInfo(false));
            }

            ///Again we don't care if it's a valid move just yet,
            ///just checking if the figure were to move to the designated
            ///position will it endanger the enemy king or not.
            bool IsEnemyKingCheck = Check_for_check(!from.IsWhite, board, Generate_attack_board(board, new Queen(to.Row, to.Col, from.IsWhite, "")));

            ChessMoveInfo MoveInfo = new ChessMoveInfo(false, from.IsWhite);

            MoveInfo.FromRow = from.Row;
            MoveInfo.FromCol = from.Col;
            MoveInfo.ToRow   = to.Row;
            MoveInfo.ToCol   = to.Col;

            if (to.Name != "Empty")
            {
                MoveInfo.TakenFigureRow = to.Row;
                MoveInfo.TakenFigureCol = to.Col;
            }

            int deltaRow = from.Row - to.Row;
            int deltaCol = from.Col - to.Col;

            if (Math.Abs(deltaRow) == Math.Abs(deltaCol))
            {
                if (deltaRow > 0 && deltaCol > 0)                 // Up Left
                {
                    for (int i = from.Row - 1, j = from.Col - 1; i != to.Row; i--, j--)
                    {
                        if (!Square_is_empty(board[i, j]))
                        {
                            return(new ChessMoveInfo(false));
                        }
                    }
                    MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                    MoveInfo.IsAllowed        = true;
                    return(MoveInfo);
                }
                if (deltaRow < 0 && deltaCol < 0)                 // Down Right
                {
                    for (int i = from.Row + 1, j = from.Col + 1; i != to.Row; i++, j++)
                    {
                        if (!Square_is_empty(board[i, j]))
                        {
                            return(new ChessMoveInfo(false));
                        }
                    }
                    MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                    MoveInfo.IsAllowed        = true;
                    return(MoveInfo);
                }
                if (deltaRow > 0 && deltaCol < 0)                 // Up Right
                {
                    for (int i = from.Row - 1, j = from.Col + 1; i != to.Row; i--, j++)
                    {
                        if (!Square_is_empty(board[i, j]))
                        {
                            return(new ChessMoveInfo(false));
                        }
                    }
                    MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                    MoveInfo.IsAllowed        = true;
                    return(MoveInfo);
                }
                if (deltaRow < 0 && deltaCol > 0)                 // Down Left
                {
                    for (int i = from.Row + 1, j = from.Col - 1; i != to.Row; i++, j--)
                    {
                        if (!Square_is_empty(board[i, j]))
                        {
                            return(new ChessMoveInfo(false));
                        }
                    }
                    MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                    MoveInfo.IsAllowed        = true;
                    return(MoveInfo);
                }
                return(new ChessMoveInfo(false));
            }
            else if (from.Row == to.Row)
            {
                for (int i = from.Col; i != to.Col; i += (from.Col > to.Col ? -1 : 1))
                {
                    if (i == from.Col)
                    {
                        continue;
                    }
                    if (!Square_is_empty(board[from.Row, i]))
                    {
                        return(new ChessMoveInfo(false));
                    }
                }
                MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                MoveInfo.IsAllowed        = true;
                return(MoveInfo);
            }
            else if (from.Col == to.Col)
            {
                for (int i = from.Row; i != to.Row; i += (from.Row > to.Row ? -1 : 1))
                {
                    if (i == from.Row)
                    {
                        continue;
                    }
                    if (!Square_is_empty(board[i, from.Col]))
                    {
                        return(new ChessMoveInfo(false));
                    }
                }
                MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                MoveInfo.IsAllowed        = true;
                return(MoveInfo);
            }
            else
            {
                return(new ChessMoveInfo(false));
            }
        }
Beispiel #9
0
        public ChessMoveInfo Check(Square[,] board, King from, ChessFigure to)
        {
            if (Check_for_color_match(from, to))
            {
                return(new ChessMoveInfo(false));
            }

            if (Check_if_king_is_check_after(board, from, to))
            {
                //Same idea but this time we check if the move puts
                //the life of our dear king in danger.
                return(new ChessMoveInfo(false));
            }

            ChessMoveInfo MoveInfo = new ChessMoveInfo(true, from.IsWhite);

            MoveInfo.FromRow = from.Row;
            MoveInfo.FromCol = from.Col;
            MoveInfo.ToRow   = to.Row;
            MoveInfo.ToCol   = to.Col;

            if (to.Name != "Empty")
            {
                MoveInfo.TakenFigureRow = to.Row;
                MoveInfo.TakenFigureCol = to.Col;
            }

            if (Math.Abs(from.Col - to.Col) == 1 && Math.Abs(from.Row - to.Row) == 1)
            {
                return(MoveInfo);
            }
            if (Math.Abs(from.Col - to.Col) == 1 && Math.Abs(from.Row - to.Row) == 0)
            {
                return(MoveInfo);
            }
            if (Math.Abs(from.Col - to.Col) == 0 && Math.Abs(from.Row - to.Row) == 1)
            {
                return(MoveInfo);
            }
            if (Constants.BoardCols == 8 && Constants.BoardRows == 8 &&
                from.HasMoved == false)
            {
                if (from.IsWhite)
                {
                    if (to.Row == 7 && to.Col == 6 &&
                        board[7, 7].Figure.Name == "Rook" && (board[7, 7].Figure as Rook).HasMoved == false &&
                        Square_is_empty(board[7, 6]) && Square_is_empty(board[7, 5]))
                    {
                        MoveInfo.WasKingSideCastle = true;
                        return(MoveInfo);
                    }
                    if (to.Row == 7 && to.Col == 2 &&
                        board[7, 0].Figure.Name == "Rook" && (board[7, 0].Figure as Rook).HasMoved == false &&
                        Square_is_empty(board[7, 1]) && Square_is_empty(board[7, 2]) && Square_is_empty(board[7, 3]))
                    {
                        MoveInfo.WasQueenSideCastle = true;
                        return(MoveInfo);
                    }
                }
                else
                {
                    if (to.Row == 0 && to.Col == 6 &&
                        board[0, 7].Figure.Name == "Rook" && (board[0, 7].Figure as Rook).HasMoved == false &&
                        Square_is_empty(board[0, 6]) && Square_is_empty(board[0, 5]))
                    {
                        MoveInfo.WasKingSideCastle = true;
                        return(MoveInfo);
                    }
                    if (to.Row == 0 && to.Col == 2 &&
                        board[0, 0].Figure.Name == "Rook" && (board[0, 0].Figure as Rook).HasMoved == false &&
                        Square_is_empty(board[0, 1]) && Square_is_empty(board[0, 2]) && Square_is_empty(board[0, 3]))
                    {
                        MoveInfo.WasQueenSideCastle = true;
                        return(MoveInfo);
                    }
                }
            }
            return(new ChessMoveInfo(false));
        }
Beispiel #10
0
        public ChessMoveInfo Check(Square[,] board, Pawn from, ChessFigure to)
        {
            if (Check_for_color_match(from, to))
            {
                return(new ChessMoveInfo(false));
            }
            bool KingIsInDanger = Check_for_check(from.IsWhite, board);             // If my King is in danger this move should save it;

            if (KingIsInDanger)
            {
                if (Check_if_king_is_check_after(board, from, to))
                {
                    // We don't care if the move is valid as long as it saves the king.
                    // After that initial check, it is asserted whether the move is valid or not
                    // and the necessary measures are taken.
                    return(new ChessMoveInfo(false));
                }
            }
            if (Check_if_king_is_check_after(board, from, to))
            {
                //Same idea but this time we check if the move puts
                //the life of our dear king in danger.
                return(new ChessMoveInfo(false));
            }

            bool IsPromotion;

            ///Again we don't care if it's a valid move just yet,
            ///just checking if the figure were to move to the designated
            ///position will it endanger the enemy king or not.
            bool IsEnemyKingCheck = Check_for_check(!from.IsWhite, board, Generate_attack_board(board, new Pawn(to.Row, to.Col, from.IsWhite, "")));

            ChessMoveInfo MoveInfo = new ChessMoveInfo(false, from.IsWhite);

            MoveInfo.FromRow = from.Row;
            MoveInfo.FromCol = from.Col;
            MoveInfo.ToRow   = to.Row;
            MoveInfo.ToCol   = to.Col;

            if (to.Name != "Empty")
            {
                MoveInfo.TakenFigureRow = to.Row;
                MoveInfo.TakenFigureCol = to.Col;
            }

            if (from.IsWhite)
            {
                IsPromotion = (to.Row == 0);
                if (from.Row - to.Row == 1)
                {
                    if (to.Col == from.Col && Square_is_empty(board[to.Row, to.Col]))
                    {
                        MoveInfo.IsAllowed        = true;
                        MoveInfo.IsPromotion      = IsPromotion;
                        MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                        return(MoveInfo);
                    }
                    else if (Math.Abs(to.Col - from.Col) == 1)
                    {
                        // If there is an enemy there then return true.
                        if (!Square_is_empty(board[to.Row, to.Col]) && to.IsWhite != from.IsWhite)
                        {
                            MoveInfo.IsAllowed        = true;
                            MoveInfo.IsPromotion      = IsPromotion;
                            MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                            return(MoveInfo);
                        }
                        else if (board[to.Row, to.Col].EnPasPossible && board[to.Row, to.Col].EnPasIsWhite == from.IsWhite)
                        {
                            MoveInfo.IsAllowed        = true;
                            MoveInfo.IsPromotion      = IsPromotion;
                            MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                            MoveInfo.TakenFigureRow   = to.Row + 1;
                            MoveInfo.TakenFigureCol   = to.Col;
                            return(MoveInfo);
                        }
                    }
                }
                else
                // To make the board scalable we use Constants and not rows 6 and 4
                if (from.Row == Constants.BoardRows - 2 && to.Row == Constants.BoardRows - 4 && from.Col == to.Col &&
                    Square_is_empty(board[Constants.BoardRows - 4, from.Col]))
                {
                    //Check if the square between the destination and the figure is empty;
                    if (Square_is_empty(board[from.Row - 1, from.Col]))
                    {
                        MoveInfo.IsAllowed        = true;
                        MoveInfo.IsPromotion      = IsPromotion;
                        MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                        MoveInfo.EnPasRow         = from.Row - 1;
                        MoveInfo.EnPasCol         = from.Col;

                        return(MoveInfo);                        // There is a possible En Passant
                    }
                }
            }
            else
            {
                IsPromotion = (to.Row == Constants.BoardRows - 1);
                if (to.Row - from.Row == 1)
                {
                    if (to.Col == from.Col && Square_is_empty(board[to.Row, to.Col]))
                    {
                        MoveInfo.IsAllowed        = true;
                        MoveInfo.IsPromotion      = IsPromotion;
                        MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                        return(MoveInfo);
                    }
                    else if (Math.Abs(to.Col - from.Col) == 1)
                    {
                        // If there is an enemy there then return true.
                        if (!Square_is_empty(board[to.Row, to.Col]) && to.IsWhite != from.IsWhite)
                        {
                            MoveInfo.IsAllowed        = true;
                            MoveInfo.IsPromotion      = IsPromotion;
                            MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                            return(MoveInfo);
                        }
                        //Check if the to square is En Passant Square
                        else if (board[to.Row, to.Col].EnPasPossible && board[to.Row, to.Col].EnPasIsWhite == from.IsWhite)
                        {
                            MoveInfo.IsAllowed        = true;
                            MoveInfo.IsPromotion      = IsPromotion;
                            MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                            MoveInfo.TakenFigureRow   = to.Row - 1;
                            MoveInfo.TakenFigureCol   = to.Col;
                            return(MoveInfo);
                        }
                    }
                }
                else
                if (from.Row == 1 && to.Row == 3 && from.Col == to.Col &&
                    Square_is_empty(board[3, from.Col]))
                {
                    //Check if the square between the destination and the figure is empty;
                    if (Square_is_empty(board[from.Row + 1, from.Col]))
                    {
                        MoveInfo.IsAllowed        = true;
                        MoveInfo.IsPromotion      = IsPromotion;
                        MoveInfo.EnemyKingIsCheck = IsEnemyKingCheck;
                        MoveInfo.EnPasRow         = from.Row + 1;
                        MoveInfo.EnPasCol         = from.Col;
                        return(MoveInfo);                        // There is a possible En Passant
                    }
                }
            }
            return(new ChessMoveInfo(false));
        }
Beispiel #11
0
 internal PuzzleSolution(ChessMoveInfo bestMove, int requiredTreeDepth)
 {
     BestMove          = bestMove;
     RequiredTreeDepth = requiredTreeDepth;
 }
Beispiel #12
0
 public static ChessMoveItem FromMove(ChessMoveInfo move, Player humanPlayer)
 {
     return(new ChessMoveItem(move, humanPlayer));
 }