/// search captures, promotions and some checks) and about how important good
/// move ordering is at the current node.
-MovePicker::MovePicker(const Position& p, bool pv, Move ttm, Depth d,
+MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
const History& h, SearchStack* ss) : pos(p), H(h) {
-
- pvNode = pv;
ttMove = ttm;
if (ss)
{
} else
mateKiller = killer1 = killer2 = MOVE_NONE;
- depth = d;
- movesPicked = 0;
- numOfMoves = 0;
- numOfBadCaptures = 0;
- checkKillers = checkLegal = false;
+ movesPicked = numOfMoves = numOfBadCaptures = 0;
+ checkKillers = checkLegal = finished = false;
if (p.is_check())
phaseIndex = EvasionsPhaseIndex;
- else if (depth > Depth(0))
+ else if (d > Depth(0))
phaseIndex = MainSearchPhaseIndex;
- else if (depth == Depth(0))
+ else if (d == Depth(0))
phaseIndex = QsearchWithChecksPhaseIndex;
else
phaseIndex = QsearchWithoutChecksPhaseIndex;
PH_STOP
};
- MovePicker(const Position& p, bool pvnode, Move ttm, Depth d, const History& h, SearchStack* ss = NULL);
+ MovePicker(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss = NULL);
Move get_next_move();
Move get_next_move(Lock& lock);
int number_of_moves() const;
Move ttMove, mateKiller, killer1, killer2;
Bitboard pinned, dc;
MoveStack moves[256], badCaptures[64];
- bool pvNode;
- Depth depth;
int phaseIndex;
int numOfMoves, numOfBadCaptures;
int movesPicked;
assert(pos.is_ok());
- MovePicker mp = MovePicker(pos, false, MOVE_NONE, OnePly, H);
+ MovePicker mp = MovePicker(pos, MOVE_NONE, OnePly, H);
// Castling moves
if (movestr == "O-O-O" || movestr == "O-O-O+")
if (type_of_piece(pc) == KING)
return AMBIGUITY_NONE;
- MovePicker mp = MovePicker(pos, false, MOVE_NONE, OnePly, H);
+ MovePicker mp = MovePicker(pos, MOVE_NONE, OnePly, H);
Move mv, moveList[8];
int n = 0;
// Initialize a MovePicker object for the current position, and prepare
// to search all moves
- MovePicker mp = MovePicker(pos, true, ttMove, depth, Threads[threadID].H, &ss[ply]);
+ MovePicker mp = MovePicker(pos, ttMove, depth, Threads[threadID].H, &ss[ply]);
Move move, movesSearched[256];
int moveCount = 0;
// Initialize a MovePicker object for the current position, and prepare
// to search all moves:
- MovePicker mp = MovePicker(pos, false, ttMove, depth, Threads[threadID].H, &ss[ply]);
+ MovePicker mp = MovePicker(pos, ttMove, depth, Threads[threadID].H, &ss[ply]);
Move move, movesSearched[256];
int moveCount = 0;
// Initialize a MovePicker object for the current position, and prepare
// to search the moves. Because the depth is <= 0 here, only captures,
// queen promotions and checks (only if depth == 0) will be generated.
- MovePicker mp = MovePicker(pos, pvNode, ttMove, depth, Threads[threadID].H);
+ MovePicker mp = MovePicker(pos, ttMove, depth, Threads[threadID].H);
Move move;
int moveCount = 0;
Bitboard dcCandidates = mp.discovered_check_candidates();