pub struct Position { /* private fields */ }Expand description
Position encodes all positional information and non-positional game state
Implementations§
Source§impl Position
impl Position
Sourcepub fn make(&mut self, mv: Move) -> Option<(Piece, Square)>
pub fn make(&mut self, mv: Move) -> Option<(Piece, Square)>
Returns piece captured and square if any
pub fn make_null_move(&mut self) -> Option<(Piece, Square)>
pub fn unmake( &mut self, mv: Move, capture: Option<(Piece, Square)>, original_state: &State, original_hash_key: u64, )
pub fn unmake_null_move( &mut self, original_state: &State, original_hash_key: u64, )
Source§impl Position
impl Position
pub fn new(grid: [Piece; 64], state: State) -> Position
Sourcepub fn from_fen(fen: &str) -> Result<Position, String>
pub fn from_fen(fen: &str) -> Result<Position, String>
Construct a new position from a FEN string
pub fn to_fen(&self) -> String
pub fn hash_key(&self) -> u64
pub fn king_square(&self, side: Side) -> Square
pub fn piece_iter(&self, pc: Piece) -> BBIterator ⓘ
Sourcepub fn bb_sliders(&self, side: Side) -> (BB, BB)
pub fn bb_sliders(&self, side: Side) -> (BB, BB)
Get bitboard of sliding pieces for a particular side
Sourcepub fn bb_occupied(&self) -> BB
pub fn bb_occupied(&self) -> BB
Get bitboard of all occupied squares
pub fn piece_square_score(&self, piece_square_table: &PieceSquareTable) -> i16
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
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