The Pedigree Project
0.1
|
Public Member Functions | |
Bitboard () | |
Bitboard (unsigned char squares[64]) | |
Bitboard (Square sq) | |
unsigned char | getRank (int n) |
void | setRank (int n, unsigned char c) |
bool | test (int rank, int file) |
bool | clear (int rank, int file) |
bool | set (int rank, int file) |
void | clear () |
bool | empty () |
void | flip () |
void | rotate180 () |
unsigned char | getDiagonalRank45 (int rank, int file, int *newFile) |
unsigned char | getDiagonalRank315 (int rank, int file, int *newFile) |
void | setDiagonalRank45 (int rank, int file, unsigned char newRank) |
void | setDiagonalRank315 (int rank, int file, unsigned char newRank) |
void | shift (int colOffset, int rowOffset) |
Square | getAndClearFirstSetBit () |
void | print () |
Bitboard | operator| (Bitboard b2) |
Bitboard | operator& (Bitboard b2) |
Bitboard | operator xor (Bitboard b2) |
Bitboard | operator~ () |
operator bool () | |
Private Attributes | |
union { | |
uint64_t i | |
unsigned char c [8] | |
} | member |
Definition at line 27 of file Bitboard.h.
Bitboard::Bitboard | ( | ) |
Constructs a bitboard, intialising to all zeroes.
Definition at line 25 of file Bitboard.cc.
Bitboard::Bitboard | ( | unsigned char | squares[64] | ) |
Constructs a bitboard, taking an array of bytes, each representing one square.
Definition at line 30 of file Bitboard.cc.
|
inline |
Clears the bit at rank, file
Definition at line 75 of file Bitboard.h.
Referenced by SideState::friendlyMove().
|
inline |
Clears the entire bitboard.
Definition at line 91 of file Bitboard.h.
|
inline |
Is this bitboard completely empty?
Definition at line 99 of file Bitboard.h.
References flip(), operator|(), print(), and rotate180().
void Bitboard::flip | ( | ) |
Flips the board so rows become columns and vice versa.
Definition at line 56 of file Bitboard.cc.
Referenced by empty().
|
inline |
Retrieves a rank in byte form.
Definition at line 51 of file Bitboard.h.
Overloaded bitwise functions.
Definition at line 209 of file Bitboard.cc.
Referenced by empty().
void Bitboard::print | ( | ) |
Debugging function - prints out a bitboard.
Definition at line 40 of file Bitboard.cc.
References test().
Referenced by empty().
void Bitboard::rotate180 | ( | ) |
Rotates the board 180 degrees. Used for swapping sides (black -> white etc)
Definition at line 77 of file Bitboard.cc.
References test().
Referenced by BoardState::dump(), empty(), BoardState::firstPawn(), BoardState::isLegal(), and BoardState::move().
|
inline |
Sets the bit at rank, file
Definition at line 83 of file Bitboard.h.
Referenced by BoardState::dump(), SideState::friendlyMove(), and SideState::isAttacking().
|
inline |
Sets a rank in byte form.
Definition at line 59 of file Bitboard.h.
|
inline |
Tests the bit at rank, file
Definition at line 67 of file Bitboard.h.
Referenced by print(), and rotate180().