X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftypes.h;h=33f84f0cd56d14607d1adf27f5b46ed46f4172cd;hb=dba1bc354a74bf7774c453ac779b3ce462c2b8e2;hp=8934cc4833bcd5755e9f72746cd785af9c4c23c2;hpb=628808a11382a3acd8501199ab58eee0e1e1e3bc;p=stockfish diff --git a/src/types.h b/src/types.h index 8934cc48..33f84f0c 100644 --- a/src/types.h +++ b/src/types.h @@ -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 +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) {