pub struct Position { /* private fields */ }
Implementations§
Source§impl Position
impl Position
pub fn legal_moves(&self) -> MoveList
pub fn legal_quiets(&self) -> MoveList
pub fn legal_captures(&self) -> MoveList
Source§impl Position
impl Position
pub fn new_initial() -> Self
pub fn new_chess960(scharnagl_number: u32) -> Self
pub fn from_fen(fen: &str) -> Result<Self, FenError>
pub fn variant(&self) -> Variant
pub fn hash(&self) -> u64
pub fn side_to_move(&self) -> Color
pub fn castling(&self, color: Color) -> Castling
pub fn our_castling(&self) -> Castling
pub fn en_passant(&self) -> Option<Square>
pub fn pseudolegal_en_passant(&self) -> Option<Square>
pub fn legal_en_passant(&self) -> Option<Square>
pub fn en_passant_target(&self) -> Option<Square>
pub fn halfmove_clock(&self) -> u32
pub fn fullmove_number(&self) -> u32
pub fn ply_number(&self) -> u32
pub fn occupied(&self) -> SquareSet
pub fn us(&self) -> SquareSet
pub fn them(&self) -> SquareSet
pub fn white(&self) -> SquareSet
pub fn black(&self) -> SquareSet
pub fn pawns(&self) -> SquareSet
pub fn knights(&self) -> SquareSet
pub fn bishops(&self) -> SquareSet
pub fn rooks(&self) -> SquareSet
pub fn queens(&self) -> SquareSet
pub fn kings(&self) -> SquareSet
pub fn colored(&self, color: Color) -> SquareSet
pub fn pieces(&self, piece: Piece) -> SquareSet
pub fn piece_at(&self, square: Square) -> Option<Piece>
pub fn color_at(&self, square: Square) -> Option<Color>
pub fn color_piece_at(&self, square: Square) -> Option<(Color, Piece)>
pub fn checkers(&self) -> SquareSet
pub fn pinned(&self) -> SquareSet
pub fn has_non_pawn_material(&self, color: Color) -> bool
Sourcepub fn has_insufficient_material(&self, color: Color) -> bool
pub fn has_insufficient_material(&self, color: Color) -> bool
Returns whether there is no sequence of moves for color
that could result in checkmate.
Sourcepub fn is_insufficient_material(&self) -> bool
pub fn is_insufficient_material(&self) -> bool
Returns whether there is no sequence of moves that could result in checkmate.
pub fn is_in_check(&self) -> bool
pub fn our_king(&self) -> Option<Square>
pub fn their_king(&self) -> Option<Square>
pub fn king(&self, color: Color) -> Option<Square>
pub fn attacking_with(&self, square: Square, occupied: SquareSet) -> SquareSet
pub fn attacking(&self, square: Square) -> SquareSet
pub fn is_legal(&self, mv: &Move) -> bool
pub fn is_pseudolegal(&self, mv: &Move) -> bool
pub fn is_safe(&self, mv: &Move) -> bool
Sourcepub fn is_capture(&self, mv: &Move) -> bool
pub fn is_capture(&self, mv: &Move) -> bool
Checks if a move is a capture. This function assumes that the given move is at least pseudolegal.
pub fn is_quiet(&self, mv: &Move) -> bool
pub fn setup(&self) -> Setup
pub fn fen(&self) -> Fen
pub fn skip(&mut self)
pub fn play<M: ToMove>(&mut self, mv: &M) -> Result<(), M::Error>
pub fn play_unchecked(&mut self, mv: &Move)
pub fn validate(&self) -> Result<(), InvalidPositionError>
Trait Implementations§
Source§impl TryFrom<Fen> for Position
impl TryFrom<Fen> for Position
Source§type Error = InvalidPositionError
type Error = InvalidPositionError
The type returned in the event of a conversion error.
impl Eq for Position
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