Struct pleco::core::bitboard::BitBoard
[−]
[src]
pub struct BitBoard(pub u64);
Defines an object to define a bitboard. a BitBoard
is simply a u64 where each
bit maps to a specific square. Used for mapping occupancy, where '1' represents
a piece being at that index's square, and a '0' represents a lack of a piece.
Methods
impl BitBoard
[src]
const FILE_A: BitBoard
FILE_A: BitBoard = BitBoard(FILE_A)
const FILE_B: BitBoard
FILE_B: BitBoard = BitBoard(FILE_B)
const FILE_C: BitBoard
FILE_C: BitBoard = BitBoard(FILE_C)
const FILE_D: BitBoard
FILE_D: BitBoard = BitBoard(FILE_D)
const FILE_E: BitBoard
FILE_E: BitBoard = BitBoard(FILE_E)
const FILE_F: BitBoard
FILE_F: BitBoard = BitBoard(FILE_F)
const FILE_G: BitBoard
FILE_G: BitBoard = BitBoard(FILE_G)
const FILE_H: BitBoard
FILE_H: BitBoard = BitBoard(FILE_H)
const RANK_1: BitBoard
RANK_1: BitBoard = BitBoard(RANK_1)
const RANK_2: BitBoard
RANK_2: BitBoard = BitBoard(RANK_2)
const RANK_3: BitBoard
RANK_3: BitBoard = BitBoard(RANK_3)
const RANK_4: BitBoard
RANK_4: BitBoard = BitBoard(RANK_4)
const RANK_5: BitBoard
RANK_5: BitBoard = BitBoard(RANK_5)
const RANK_6: BitBoard
RANK_6: BitBoard = BitBoard(RANK_6)
const RANK_7: BitBoard
RANK_7: BitBoard = BitBoard(RANK_7)
const RANK_8: BitBoard
RANK_8: BitBoard = BitBoard(RANK_8)
fn to_sq(self) -> SQ
[src]
Converts a BitBoard
to a square.
Safety
The BitBoard
must have exactly one bit inside of it, or else
this will return the square of the least significant bit.
fn count_bits(self) -> u8
[src]
Returns the number of bits in a BitBoard
fn bit_scan_forward(self) -> SQ
[src]
fn bit_scan_forward_u8(self) -> u8
[src]
fn more_than_one(self) -> bool
[src]
Returns if there are more than 1 bits inside.
fn is_empty(self) -> bool
[src]
Determines if the BitBoard
is empty (contains no bits).
fn is_not_empty(self) -> bool
[src]
Determines if the BitBoard
is not empty (contains one or more bits).
fn lsb(self) -> BitBoard
[src]
Returns the least significant bit as a BitBoard.
fn lsb_u64(self) -> u64
[src]
Returns the least significant bit as a u64.
fn start_bbs() -> [[BitBoard; 6]; 2]
[src]
Array containing all the BitBoards
for of the starting position, for each player and piece.
fn clone_all_occ(bbs: &[[BitBoard; 6]; 2]) -> [[BitBoard; 6]; 2]
[src]
Returns a clone of a [[BitBoard; 6]; 2]
. Used to duplicate occupancy BitBoard
s of each
piece for each player.
fn clone_occ_bbs(bbs: &[BitBoard; 2]) -> [BitBoard; 2]
[src]
Returns a clone of a [BitBoard; 2]
. Used to duplicate occupancy BitBoard
s of each player.
Trait Implementations
impl Copy for BitBoard
[src]
impl Clone for BitBoard
[src]
fn clone(&self) -> BitBoard
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for BitBoard
[src]
impl Hash for BitBoard
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for BitBoard
[src]
fn eq(&self, __arg_0: &BitBoard) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &BitBoard) -> bool
[src]
This method tests for !=
.
impl Eq for BitBoard
[src]
impl Debug for BitBoard
[src]
impl From<u64> for BitBoard
[src]
impl Rem for BitBoard
[src]
type Output = BitBoard
The resulting type after applying the %
operator.
fn rem(self, rhs: BitBoard) -> BitBoard
[src]
Performs the %
operation.
impl RemAssign for BitBoard
[src]
fn rem_assign(&mut self, rhs: BitBoard)
[src]
Performs the %=
operation.
impl BitOr for BitBoard
[src]
type Output = BitBoard
The resulting type after applying the |
operator.
fn bitor(self, rhs: BitBoard) -> BitBoard
[src]
Performs the |
operation.
impl BitOrAssign for BitBoard
[src]
fn bitor_assign(&mut self, rhs: BitBoard)
[src]
Performs the |=
operation.
impl BitAnd for BitBoard
[src]
type Output = BitBoard
The resulting type after applying the &
operator.
fn bitand(self, rhs: BitBoard) -> BitBoard
[src]
Performs the &
operation.
impl BitAndAssign for BitBoard
[src]
fn bitand_assign(&mut self, rhs: BitBoard)
[src]
Performs the &=
operation.
impl BitXor for BitBoard
[src]
type Output = BitBoard
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: BitBoard) -> BitBoard
[src]
Performs the ^
operation.
impl BitXorAssign for BitBoard
[src]
fn bitxor_assign(&mut self, rhs: BitBoard)
[src]
Performs the ^=
operation.
impl Add for BitBoard
[src]
type Output = BitBoard
The resulting type after applying the +
operator.
fn add(self, rhs: BitBoard) -> BitBoard
[src]
Performs the +
operation.
impl AddAssign for BitBoard
[src]
fn add_assign(&mut self, rhs: BitBoard)
[src]
Performs the +=
operation.
impl Div for BitBoard
[src]
type Output = BitBoard
The resulting type after applying the /
operator.
fn div(self, rhs: BitBoard) -> BitBoard
[src]
Performs the /
operation.
impl DivAssign for BitBoard
[src]
fn div_assign(&mut self, rhs: BitBoard)
[src]
Performs the /=
operation.
impl Mul for BitBoard
[src]
type Output = BitBoard
The resulting type after applying the *
operator.
fn mul(self, rhs: BitBoard) -> BitBoard
[src]
Performs the *
operation.
impl MulAssign for BitBoard
[src]
fn mul_assign(&mut self, rhs: BitBoard)
[src]
Performs the *=
operation.
impl Sub for BitBoard
[src]
type Output = BitBoard
The resulting type after applying the -
operator.
fn sub(self, rhs: BitBoard) -> BitBoard
[src]
Performs the -
operation.
impl SubAssign for BitBoard
[src]
fn sub_assign(&mut self, rhs: BitBoard)
[src]
Performs the -=
operation.
impl Shl<usize> for BitBoard
[src]
type Output = BitBoard
The resulting type after applying the <<
operator.
fn shl(self, rhs: usize) -> BitBoard
[src]
Performs the <<
operation.
impl ShlAssign<usize> for BitBoard
[src]
fn shl_assign(&mut self, rhs: usize)
[src]
Performs the <<=
operation.
impl Shr<usize> for BitBoard
[src]
type Output = BitBoard
The resulting type after applying the >>
operator.
fn shr(self, rhs: usize) -> BitBoard
[src]
Performs the >>
operation.
impl ShrAssign<usize> for BitBoard
[src]
fn shr_assign(&mut self, rhs: usize)
[src]
Performs the >>=
operation.
impl Not for BitBoard
[src]
type Output = BitBoard
The resulting type after applying the !
operator.
fn not(self) -> BitBoard
[src]
Performs the unary !
operation.