Bitboards: added PopBit()
This commit is contained in:
1 parent
13c7bcc092
commit
20f0ea142a
4 files changed
+9
-6
No files matched your search
@@ -30,6 +30,12 @@ void Bitboard::SetBit(int square) {
|
||||
m_board |= (1ULL << square);
|
||||
}
|
||||
|
||||
void Bitboard::PopBit(int square) {
|
||||
if (Bitboard(m_board).IsSet(square)) {
|
||||
m_board &= (~Bitboard::GetSquare(square)).GetBoard();
|
||||
}
|
||||
}
|
||||
|
||||
int Bitboard::popCount() const {
|
||||
U64 board = m_board;
|
||||
int count = 0;
|
||||
@@ -76,9 +82,6 @@ Bitboard Bitboard::operator|=(const Bitboard& other) {
|
||||
Bitboard Bitboard::operator^=(const Bitboard& other) {
|
||||
return m_board ^= other.m_board;
|
||||
}
|
||||
Bitboard Bitboard::operator*=(const Bitboard& other) {
|
||||
return m_board *= other.m_board;
|
||||
}
|
||||
|
||||
Bitboard Bitboard::operator<<(int other) {
|
||||
if (other > 0) {
|
||||
|
||||
Reference in new issue
Block a user