refactor: Rename addMill to millsCount

This commit is contained in:
Calcitem 2020-12-31 03:16:27 +08:00
parent 3f85a41652
commit f7f72222c7
3 changed files with 7 additions and 7 deletions

View File

@ -808,7 +808,7 @@ bool Position::put_piece(Square s, bool updateCmdlist)
currentSquare = s;
int n = add_mills(currentSquare);
int n = mills_count(currentSquare);
if (n == 0) {
assert(pieceInHandCount[BLACK] >= 0 && pieceInHandCount[WHITE] >= 0);
@ -879,7 +879,7 @@ bool Position::put_piece(Square s, bool updateCmdlist)
SET_BIT(byColorBB[color_of(pc)], s);
currentSquare = s;
int n = add_mills(currentSquare);
int n = mills_count(currentSquare);
// midgame
if (n == 0) {
@ -1450,7 +1450,7 @@ int Position::potential_mills_count(Square to, Color c, Square from)
return n;
}
int Position::add_mills(Square s)
int Position::mills_count(Square s)
{
int n = 0;

View File

@ -132,7 +132,7 @@ public:
void reset_bb();
void create_mill_table();
int add_mills(Square s);
int mills_count(Square s);
// The number of mills that would be closed by the given move.
int potential_mills_count(Square to, Color c, Square from = SQ_0);

View File

@ -523,7 +523,7 @@ class Position {
currentSquare = s;
int n = addMills(currentSquare);
int n = millsCount(currentSquare);
if (n == 0) {
assert(pieceInHandCount[Color.black] >= 0 &&
@ -594,7 +594,7 @@ class Position {
_grid[squareToIndex[currentSquare]] = Piece.noPiece;
currentSquare = s;
int n = addMills(currentSquare);
int n = millsCount(currentSquare);
// midgame
if (n == 0) {
@ -1351,7 +1351,7 @@ class Position {
return n;
}
int addMills(int s) {
int millsCount(int s) {
int n = 0;
List<int> idx = [0, 0, 0];
int min;