Ejemplo n.º 1
0
        public override MoveEventResponse TestForWinLossDraw(int currentPlayer, int ply)
        {
            MaterialHashType type = lookupPosition();

            if (type == MaterialHashType.InstantDraw)
            {
                return(MoveEventResponse.GameDrawn);
            }

            return(MoveEventResponse.NotHandled);
        }
Ejemplo n.º 2
0
        public override void AdjustEvaluation(ref int midgameEval, ref int endgameEval)
        {
            MaterialHashType type = lookupPosition();

            if (type == MaterialHashType.ZeroEvaluation ||
                type == MaterialHashType.InstantDraw)
            {
                midgameEval = 0;
                endgameEval = 0;
                return;
            }

            if (type == MaterialHashType.EvalDivideByFour)
            {
                midgameEval /= 4;
                endgameEval /= 4;
                return;
            }

            if (type == MaterialHashType.ValueFunctionKXK)
            {
                evaluateKxK(ref midgameEval, ref endgameEval);
                return;
            }

            if (type == MaterialHashType.ValueFunctionKRKP)
            {
                evaluateKRKP(ref midgameEval, ref endgameEval);
                return;
            }

            if (type == MaterialHashType.ValueFunctionKRKB)
            {
                evaluateKRKB(ref midgameEval, ref endgameEval);
                return;
            }

            if (type == MaterialHashType.ValueFunctionKRKN)
            {
                evaluateKRKN(ref midgameEval, ref endgameEval);
                return;
            }
        }