refactor: _selectPiece 改名为 select_piece
This commit is contained in:
parent
c9703a9aff
commit
ca6bbb491a
|
@ -337,7 +337,7 @@ ExtMove *generateMoves(/* TODO: const */ Position *position, ExtMove *moveList)
|
|||
for (int i = Board::MOVE_PRIORITY_TABLE_SIZE - 1; i >= 0; i--) {
|
||||
oldSquare = static_cast<Square>(MoveList::movePriorityTable[i]);
|
||||
|
||||
if (!position->_selectPiece(oldSquare)) {
|
||||
if (!position->select_piece(oldSquare)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -472,7 +472,7 @@ out:
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Position::_selectPiece(Square square)
|
||||
bool Position::select_piece(Square square)
|
||||
{
|
||||
if (phase != PHASE_MOVING)
|
||||
return false;
|
||||
|
@ -492,7 +492,7 @@ bool Position::_selectPiece(Square square)
|
|||
|
||||
bool Position::_selectPiece(File file, Rank rank)
|
||||
{
|
||||
return _selectPiece(Board::polarToSquare(file, rank));
|
||||
return select_piece(Board::polarToSquare(file, rank));
|
||||
}
|
||||
|
||||
bool Position::giveup(Color loser)
|
||||
|
@ -602,7 +602,7 @@ bool Position::do_move(Move m)
|
|||
case MOVETYPE_REMOVE:
|
||||
return remove_piece(static_cast<Square>(-m));
|
||||
case MOVETYPE_MOVE:
|
||||
if (_selectPiece(from_sq(m))) {
|
||||
if (select_piece(from_sq(m))) {
|
||||
return place_piece(to_sq(m));
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
Position &operator=(const Position &) = delete;
|
||||
|
||||
// Properties of moves
|
||||
bool _selectPiece(Square s);
|
||||
bool select_piece(Square s);
|
||||
bool place_piece(Square s, bool updateCmdlist = false);
|
||||
bool remove_piece(Square s, bool updateCmdlist = false);
|
||||
|
||||
|
|
Loading…
Reference in New Issue