X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftypes.h;h=33f84f0cd56d14607d1adf27f5b46ed46f4172cd;hb=dba1bc354a74bf7774c453ac779b3ce462c2b8e2;hp=17661c01e800a12b3ee61108173e8773be171477;hpb=dc7fd868f4fa41251a9521a0b25e3adb483bfd83;p=stockfish diff --git a/src/types.h b/src/types.h index 17661c01..33f84f0c 100644 --- a/src/types.h +++ b/src/types.h @@ -415,10 +415,6 @@ inline int square_distance(Square s1, Square s2) { return SquareDistance[s1][s2]; } -inline char piece_type_to_char(PieceType pt) { - return " PNBRQK"[pt]; -} - inline char file_to_char(File f) { return char(f - FILE_A + int('a')); } @@ -451,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) {