Struct shakmaty::Board
[−]
[src]
pub struct Board { /* fields omitted */ }
Piece
positions on a board.
Examples
let board = Board::new(); // r n b q k b n r // p p p p p p p p // . . . . . . . . // . . . . . . . . // . . . . . . . . // . . . . . . . . // P P P P P P P P // R N B Q K B N R assert_eq!(board.piece_at(Square::E8), Some(Black.king()));
Methods
impl Board
[src]
fn new() -> Board
[src]
fn empty() -> Board
[src]
fn occupied(&self) -> Bitboard
[src]
fn pawns(&self) -> Bitboard
[src]
fn knights(&self) -> Bitboard
[src]
fn bishops(&self) -> Bitboard
[src]
fn rooks(&self) -> Bitboard
[src]
fn queens(&self) -> Bitboard
[src]
fn kings(&self) -> Bitboard
[src]
fn white(&self) -> Bitboard
[src]
fn black(&self) -> Bitboard
[src]
fn promoted(&self) -> Bitboard
[src]
fn sliders(&self) -> Bitboard
[src]
Bishops, rooks and queens.
fn rooks_and_queens(&self) -> Bitboard
[src]
fn bishops_and_queens(&self) -> Bitboard
[src]
fn king_of(&self, color: Color) -> Option<Square>
[src]
The (unique, unpromoted) king of the given side.
fn color_at(&self, sq: Square) -> Option<Color>
[src]
fn role_at(&self, sq: Square) -> Option<Role>
[src]
fn piece_at(&self, sq: Square) -> Option<Piece>
[src]
fn remove_piece_at(&mut self, sq: Square) -> Option<Piece>
[src]
fn discard_piece_at(&mut self, sq: Square)
[src]
fn set_piece_at(
&mut self,
sq: Square,
Piece { color: color, role: role }: Piece,
promoted: bool
)
[src]
&mut self,
sq: Square,
Piece { color: color, role: role }: Piece,
promoted: bool
)
fn by_color(&self, color: Color) -> Bitboard
[src]
fn by_role(&self, role: Role) -> Bitboard
[src]
fn by_piece(&self, piece: Piece) -> Bitboard
[src]
fn attacks_from(&self, sq: Square) -> Bitboard
[src]
fn attacks_to(
&self,
sq: Square,
attacker: Color,
occupied: Bitboard
) -> Bitboard
[src]
&self,
sq: Square,
attacker: Color,
occupied: Bitboard
) -> Bitboard
fn pieces(&self) -> Pieces
[src]
Trait Implementations
impl Clone for Board
[src]
fn clone(&self) -> Board
[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 Eq for Board
[src]
impl PartialEq for Board
[src]
fn eq(&self, __arg_0: &Board) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Board) -> bool
[src]
This method tests for !=
.
impl Default for Board
[src]
impl Debug for Board
[src]
impl Extend<(Square, Piece)> for Board
[src]
fn extend<T: IntoIterator<Item = (Square, Piece)>>(&mut self, iter: T)
[src]
Extends a collection with the contents of an iterator. Read more
impl FromIterator<(Square, Piece)> for Board
[src]
fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = (Square, Piece)>,
[src]
T: IntoIterator<Item = (Square, Piece)>,
Creates a value from an iterator. Read more
impl FromStr for Board
[src]
type Err = FenError
The associated error which can be returned from parsing.
fn from_str(board_fen: &str) -> Result<Board, FenError>
[src]
Parses a string s
to return a value of this type. Read more