pub struct PieceBoardState {
pub p1_pieces: u64,
pub all_pieces: u64,
pub elephants: u64,
pub camels: u64,
pub horses: u64,
pub dogs: u64,
pub cats: u64,
pub rabbits: u64,
}Expand description
A set of bitboards representing the game state. Bits are in the perspective of player 1. Bits are left to right, top to bottom:
- First bit is the top left square (A8).
- Second bit is to the right. (B8).
- Last bit being the bottom right (H1).
Fields§
§p1_pieces: u64§all_pieces: u64§elephants: u64§camels: u64§horses: u64§dogs: u64§cats: u64§rabbits: u64Implementations§
Source§impl PieceBoardState
impl PieceBoardState
Sourcepub fn bits_for_piece(&self, piece: Piece, p1_pieces: bool) -> u64
pub fn bits_for_piece(&self, piece: Piece, p1_pieces: bool) -> u64
Returns the bits for a specific piece type for a specific player.
Sourcepub fn player_piece_mask(&self, p1_pieces: bool) -> u64
pub fn player_piece_mask(&self, p1_pieces: bool) -> u64
Returns a bit board where each bit represents a current player’s piece on that square
pub fn bits_by_piece_type(&self, piece: Piece) -> u64
pub fn placement_bit(&self) -> u64
pub fn trapped_piece_bits(&self) -> u64
pub fn piece_type_at_square(&self, square: &Square) -> Option<Piece>
Trait Implementations§
Source§impl Clone for PieceBoardState
impl Clone for PieceBoardState
Source§fn clone(&self) -> PieceBoardState
fn clone(&self) -> PieceBoardState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PieceBoardState
impl RefUnwindSafe for PieceBoardState
impl Send for PieceBoardState
impl Sync for PieceBoardState
impl Unpin for PieceBoardState
impl UnwindSafe for PieceBoardState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more