pub struct Board { /* private fields */ }
Implementations§
Source§impl Board
impl Board
pub fn constraints_impl( &mut self, computation_type: MoveComputeType, ) -> MoveConstraints
Source§impl Board
impl Board
pub fn compute_discoveries(&self) -> RaySet
Source§impl Board
impl Board
pub fn pinned_set_impl(&mut self) -> RaySet
Source§impl Board
impl Board
pub fn termination_status_impl(&mut self) -> Option<Termination>
Source§impl Board
impl Board
pub fn clear_cache(&mut self)
impl Board
This impl block contains no items.
Implementation of board evolution/devolution via some given Move instance which is assumed to be legal for this board.
Source§impl Board
impl Board
pub fn compute_moves_impl( &mut self, computation_type: MoveComputeType, ) -> Vec<Move>
Trait Implementations§
Source§impl ChessBoard for Board
impl ChessBoard for Board
Source§fn make(&mut self, mv: Move) -> Result<(), Error>
fn make(&mut self, mv: Move) -> Result<(), Error>
Evolves the position by making the given move. If the source hash
of the move does not match the hash of this position (prior to making
the move) then an error will be returned. If the hash matches but
the move is illegal in this position (e.g if you manually start
creating moves) then the results are undefined.
Source§fn unmake(&mut self) -> Result<Move, Error>
fn unmake(&mut self) -> Result<Move, Error>
Reverses and returns the move which was made last. If no move has
been made yet then an error is returned.
Source§fn compute_moves(&mut self, computation_type: MoveComputeType) -> Vec<Move>
fn compute_moves(&mut self, computation_type: MoveComputeType) -> Vec<Move>
Compute a vector of all the legal moves in this position for the
given computation type. Note there is no particular ordering to the
move vector.
Source§fn termination_status(&mut self) -> Option<Termination>
fn termination_status(&mut self) -> Option<Termination>
Compute the termination state of this node. If it is not terminal
nothing is returned, if it is then the manner of termination is
returned wrapped inside an Option. The termination can be only a
draw or a loss since a side only loses when it runs out of moves,
i.e. you don’t play a winning move, you just fail to have a legal
move.
Source§fn active(&self) -> Side
fn active(&self) -> Side
Return the active side in this position, i.e. the one whose turn it is.
Source§fn piece(&self, location: Square) -> Option<Piece>
fn piece(&self, location: Square) -> Option<Piece>
Return the piece occupying the given location.
Source§fn half_move_clock(&self) -> usize
fn half_move_clock(&self) -> usize
Return the half move clock value at this position.
Source§fn position_count(&self) -> usize
fn position_count(&self) -> usize
Return the number of previous positions for this board.
Source§fn remaining_rights(&self) -> EnumSet<CastleZone>
fn remaining_rights(&self) -> EnumSet<CastleZone>
Return the remaining castling rights from this position.
Source§fn play_pgn(&mut self, moves: &str) -> Result<Vec<Move>, Error>
fn play_pgn(&mut self, moves: &str) -> Result<Vec<Move>, Error>
Parse the given string as a sequence of pgn encoded moves
starting from the current position. The moves are then
made one by one. The sequence of moves which were made
are returned in a Vec.
Source§fn play_uci(&mut self, moves: &str) -> Result<Vec<Move>, Error>
fn play_uci(&mut self, moves: &str) -> Result<Vec<Move>, Error>
Parse the given string as a sequence of uci encoded moves
starting from the current position. The moves are then
made one by one.The sequence of moves which were made
are returned in a Vec.
Source§fn parse_uci(&mut self, uci_move: &str) -> Result<Move, Error>
fn parse_uci(&mut self, uci_move: &str) -> Result<Move, Error>
Given a uci encoded move this method will attempt to match
it to the unique matching legal move in this position if it
exist. An error is returned if no matching move exists in
this position.
Source§fn to_partial_fen(&self, cmps: &[FenComponent]) -> String
fn to_partial_fen(&self, cmps: &[FenComponent]) -> String
Return the specified components of the FEN encoding of this position
in the given order with components separated by a space.
Source§fn all_pieces(&self) -> BitBoard
fn all_pieces(&self) -> BitBoard
Returns the locations of all pieces on the board.
Auto Trait Implementations§
impl Freeze for Board
impl RefUnwindSafe for Board
impl Send for Board
impl Sync for Board
impl Unpin for Board
impl UnwindSafe for Board
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more