示例#1
0
        protected override Int32 Evaluate(ChessBoard myBoard, ChessPiece turn, Int16 depth)
        {
            IncrementSearchCount();
            var materialValue = (turn == ChessPiece.White ? 1 : -1) * myBoard.GetMaterialValue(this.ChessPieceRelativeValues, depth);
            var positionalValue = (turn == ChessPiece.White ? 1 : -1) * myBoard.GetPositionalValue();

            return MaterialFactor * materialValue + PositionalFactor * positionalValue;
        }
示例#2
0
        protected override Int32 Evaluate(ChessBoard myBoard, ChessPiece turn, Int16 depth)
        {
            //bool canMove;
            IncrementSearchCount();
            var materialValue = myBoard.GetMaterialValue(this.ChessPieceRelativeValues, depth);
            var positionalValue = myBoard.GetPositionalValue();

            /*  TBD!!
            if (!canMove)
            {
                if (turn == this.MySuit)
                {
                    // I am mated or stale mated
                    return myBoard.InCheck(turn) ? -WonScore : StaleMateScore;
                }
                else
                {
                    // Opponent is mated or stale mated
                    return myBoard.InCheck(turn) ? WonScore : StaleMateScore;
                }
            }*/

            return MaterialFactor * materialValue + PositionalFactor * positionalValue;
        }