- case CHECKS:
- endMoves = generate<QUIET_CHECKS>(pos, moves);
- break;
-
- case EVASION: case QSEARCH_WITH_CHECKS: case QSEARCH_WITHOUT_CHECKS:
- case PROBCUT: case RECAPTURE: case STOP:
- stage = STOP;
- break;
-
- default:
- assert(false);
- }
-}
-
-int MovePicker::see_sign() const
-{
- return stage == GOOD_CAPTURES ? 1
- : stage == BAD_CAPTURES ? -1 : 0;
-}
-
-/// next_move() is the most important method of the MovePicker class. It returns
-/// a new pseudo legal move every time it is called, until there are no more moves
-/// left. It picks the move with the biggest value from a list of generated moves
-/// taking care not to return the ttMove if it has already been searched.
-
-Move MovePicker::next_move() {
-
- Move move;
-
- while (true)
- {
- while (cur == endMoves && stage != STOP)
- generate_next_stage();
-
- switch (stage) {
-
- case MAIN_SEARCH: case EVASION: case QSEARCH_WITH_CHECKS:
- case QSEARCH_WITHOUT_CHECKS: case PROBCUT:
- ++cur;
- return ttMove;
-
- case GOOD_CAPTURES: