position: 增加 put_piece(Piece pc, Square s) 函数但暂未使用

This commit is contained in:
Calcitem 2020-10-21 22:59:32 +08:00
parent 7734ea5a31
commit 971fed440d
1 changed files with 15 additions and 0 deletions

View File

@ -178,6 +178,7 @@ public:
bool select_piece(Square s); bool select_piece(Square s);
bool select_piece(File file, Rank rank); bool select_piece(File file, Rank rank);
void put_piece(Piece pc, Square s);
bool put_piece(File file, Rank rank); bool put_piece(File file, Rank rank);
bool put_piece(Square s, bool updateCmdlist = false); bool put_piece(Square s, bool updateCmdlist = false);
bool undo_put_piece(Square s); bool undo_put_piece(Square s);
@ -322,6 +323,20 @@ inline bool Position::select_piece(File f, Rank r)
return select_piece(make_square(f, r)); return select_piece(make_square(f, r));
} }
inline void Position::put_piece(Piece pc, Square s)
{
// TODO: put_piece
#if 0
board[s] = pc;
byTypeBB[ALL_PIECES] |= s;
byTypeBB[type_of(pc)] |= s;
byColorBB[color_of(pc)] |= s;
index[s] = pieceCount[pc]++;
pieceList[pc][index[s]] = s;
pieceCount[make_piece(color_of(pc), ALL_PIECES)]++;
#endif
}
inline bool Position::put_piece(File f, Rank r) inline bool Position::put_piece(File f, Rank r)
{ {
bool ret = put_piece(make_square(f, r), true); bool ret = put_piece(make_square(f, r), true);