position: 增加几个 undo 函数声明但暂未完成编码实现

This commit is contained in:
Calcitem 2020-09-23 00:30:11 +08:00
parent 415dafd47d
commit f44d6d2fd4
1 changed files with 14 additions and 3 deletions

View File

@ -172,12 +172,18 @@ public:
// Other helpers
bool select_piece(Square s);
bool select_piece(File file, Rank rank);
bool put_piece(Square s, bool updateCmdlist = false);
bool put_piece(File file, Rank rank);
bool remove_piece(Square s, bool updateCmdlist = false);
bool put_piece(Square s, bool updateCmdlist = false);
bool undo_put_piece(Square s);
bool remove_piece(File file, Rank rank);
bool move_piece(Square from, Square to);
bool remove_piece(Square s, bool updateCmdlist = false);
bool undo_remove_piece(Square s);
bool move_piece(File f1, Rank r1, File f2, Rank r2);
bool move_piece(Square from, Square to);
bool undo_move_piece(Square from, Square to);
// Data members
Piece board[SQUARE_NB];
@ -351,6 +357,11 @@ inline bool Position::move_piece(Square from, Square to)
return false;
}
inline bool Position::undo_move_piece(Square from, Square to)
{
return move_piece(to, from); // TODO
}
/// Mill Game
inline Piece *Position::get_board() const