// Is the move check? We don't use pos.move_is_check(m) here, because
// Position::move_is_check doesn't detect all checks (not castling moves,
// promotions and en passant captures).
- UndoInfo u;
+ StateInfo st;
Position p(pos);
- p.do_move(m, u);
+ p.do_move(m, st);
if (p.is_check())
san += p.is_mate()? "#" : "+";
for (size_t i = 0; i < movestr.length(); i++)
{
char type, c = movestr[i];
- if (pieceLetters.find(c) != -1)
+ if (pieceLetters.find(c) != std::string::npos)
type = 'P';
else if (c >= 'a' && c <= 'h')
type = 'F';
toRank = rank_from_char(c);
state = (i < movestr.length() - 1) ? PROMOTION_OR_CHECK : END;
}
- else if (state == TO_FILE && fromRank == FILE_NONE)
+ else if (state == TO_FILE && fromRank == RANK_NONE)
{
// It's a disambiguation rank instead of a file
fromRank = rank_from_char(c);
return MOVE_NONE;
// Look for a matching move
- Move m, move;
+ Move m, move = MOVE_NONE;
to = make_square(toFile, toRank);
int matches = 0;
const std::string line_to_san(const Position& pos, Move line[], int startColumn, bool breakLines) {
- UndoInfo u;
+ StateInfo st;
std::stringstream s;
std::string moveStr;
size_t length = 0;
s << moveStr << ' ';
if (line[i] == MOVE_NULL)
- p.do_null_move(u);
+ p.do_null_move(st);
else
- p.do_move(line[i], u);
+ p.do_move(line[i], st);
}
return s.str();
}