Use type_of() to categorize the moves

Needed to rename old MoveType (used in move generation)
to GenType.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-06-24 10:08:16 +01:00
parent 7b4aa10708
commit dc7fd868f4
11 changed files with 113 additions and 117 deletions

View File

@@ -424,14 +424,14 @@ inline bool Position::is_chess960() const {
inline bool Position::is_capture_or_promotion(Move m) const {
assert(is_ok(m));
return is_special(m) ? !is_castle(m) : !is_empty(to_sq(m));
return type_of(m) ? type_of(m) != CASTLE : !is_empty(to_sq(m));
}
inline bool Position::is_capture(Move m) const {
// Note that castle is coded as "king captures the rook"
assert(is_ok(m));
return (!is_empty(to_sq(m)) && !is_castle(m)) || is_enpassant(m);
return (!is_empty(to_sq(m)) && type_of(m) != CASTLE) || type_of(m) == ENPASSANT;
}
inline PieceType Position::captured_piece_type() const {