Use MoveList also in Position::move_is_pl_slow()

And rename it in Position::move_is_legal()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2011-07-03 10:38:20 +01:00
parent 95d9687d95
commit 155bed18f5
4 changed files with 19 additions and 24 deletions

View File

@@ -77,11 +77,17 @@ Move move_from_uci(const Position& pos, const string& str) {
/// move_to_san() takes a position and a move as input, where it is assumed
/// that the move is a legal move from the position. The return value is
/// that the move is a legal move for the position. The return value is
/// a string containing the move in short algebraic notation.
const string move_to_san(Position& pos, Move m) {
if (m == MOVE_NONE)
return "(none)";
if (m == MOVE_NULL)
return "(null)";
assert(pos.is_ok());
assert(move_is_ok(m));
@@ -92,12 +98,6 @@ const string move_to_san(Position& pos, Move m) {
PieceType pt = piece_type(pos.piece_on(from));
string san;
if (m == MOVE_NONE)
return "(none)";
if (m == MOVE_NULL)
return "(null)";
if (move_is_castle(m))
san = (move_to(m) < move_from(m) ? "O-O-O" : "O-O");
else