Templetize make_move() helpers

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-06-25 07:57:28 +01:00
parent ebe8009aff
commit dc88cd691f
3 changed files with 11 additions and 18 deletions

View File

@@ -447,16 +447,9 @@ inline Move make_move(Square from, Square to) {
return Move(to | (from << 6));
}
inline Move make_promotion(Square from, Square to, PieceType pt) {
return Move(to | (from << 6) | (1 << 14) | ((pt - 2) << 12)) ;
}
inline Move make_enpassant(Square from, Square to) {
return Move(to | (from << 6) | (2 << 14));
}
inline Move make_castle(Square from, Square to) {
return Move(to | (from << 6) | (3 << 14));
template<MoveType T>
inline Move make(Square from, Square to, PieceType pt = KNIGHT) {
return Move(to | (from << 6) | T | ((pt - KNIGHT) << 12)) ;
}
inline bool is_ok(Move m) {