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]
impl Board
pub fn new() -> Board
[src]
pub fn new() -> Board
pub fn empty() -> Board
[src]
pub fn empty() -> Board
pub fn racing_kings() -> Board
[src]
pub fn racing_kings() -> Board
pub fn horde() -> Board
[src]
pub fn horde() -> Board
ⓘImportant traits for Bitboardpub fn occupied(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn occupied(&self) -> Bitboard
ⓘImportant traits for Bitboardpub fn pawns(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn pawns(&self) -> Bitboard
ⓘImportant traits for Bitboardpub fn knights(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn knights(&self) -> Bitboard
ⓘImportant traits for Bitboardpub fn bishops(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn bishops(&self) -> Bitboard
ⓘImportant traits for Bitboardpub fn rooks(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn rooks(&self) -> Bitboard
ⓘImportant traits for Bitboardpub fn queens(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn queens(&self) -> Bitboard
ⓘImportant traits for Bitboardpub fn kings(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn kings(&self) -> Bitboard
ⓘImportant traits for Bitboardpub fn white(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn white(&self) -> Bitboard
ⓘImportant traits for Bitboardpub fn black(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn black(&self) -> Bitboard
ⓘImportant traits for Bitboardpub fn promoted(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn promoted(&self) -> Bitboard
ⓘImportant traits for Bitboardpub fn sliders(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn sliders(&self) -> Bitboard
Bishops, rooks and queens.
ⓘImportant traits for Bitboardpub fn steppers(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn steppers(&self) -> Bitboard
Pawns, knights and kings.
ⓘImportant traits for Bitboardpub fn rooks_and_queens(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn rooks_and_queens(&self) -> Bitboard
ⓘImportant traits for Bitboardpub fn bishops_and_queens(&self) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn bishops_and_queens(&self) -> Bitboard
pub fn king_of(&self, color: Color) -> Option<Square>
[src]
pub fn king_of(&self, color: Color) -> Option<Square>
The (unique, unpromoted) king of the given side.
pub fn color_at(&self, sq: Square) -> Option<Color>
[src]
pub fn color_at(&self, sq: Square) -> Option<Color>
pub fn role_at(&self, sq: Square) -> Option<Role>
[src]
pub fn role_at(&self, sq: Square) -> Option<Role>
pub fn piece_at(&self, sq: Square) -> Option<Piece>
[src]
pub fn piece_at(&self, sq: Square) -> Option<Piece>
pub fn remove_piece_at(&mut self, sq: Square) -> Option<Piece>
[src]
pub fn remove_piece_at(&mut self, sq: Square) -> Option<Piece>
pub fn discard_piece_at(&mut self, sq: Square)
[src]
pub fn discard_piece_at(&mut self, sq: Square)
pub fn set_piece_at(
&mut self,
sq: Square,
Piece { color: color, role: role }: Piece,
promoted: bool
)
[src]
pub fn set_piece_at(
&mut self,
sq: Square,
Piece { color: color, role: role }: Piece,
promoted: bool
)
ⓘImportant traits for Bitboardpub fn by_color(&self, color: Color) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn by_color(&self, color: Color) -> Bitboard
ⓘImportant traits for Bitboardpub fn by_role(&self, role: Role) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn by_role(&self, role: Role) -> Bitboard
ⓘImportant traits for Bitboardpub fn by_piece(&self, piece: Piece) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn by_piece(&self, piece: Piece) -> Bitboard
ⓘImportant traits for Bitboardpub fn attacks_from(&self, sq: Square) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn attacks_from(&self, sq: Square) -> Bitboard
ⓘImportant traits for Bitboardpub fn attacks_to(
&self,
sq: Square,
attacker: Color,
occupied: Bitboard
) -> Bitboard
[src]
ⓘImportant traits for Bitboard
pub fn attacks_to(
&self,
sq: Square,
attacker: Color,
occupied: Bitboard
) -> Bitboard
ⓘImportant traits for Piecespub fn pieces(&self) -> Pieces
[src]
ⓘImportant traits for Pieces
pub fn pieces(&self) -> Pieces
Trait Implementations
impl Clone for Board
[src]
impl Clone for Board
fn clone(&self) -> Board
[src]
fn clone(&self) -> Board
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Eq for Board
[src]
impl Eq for Board
impl PartialEq for Board
[src]
impl PartialEq for Board
fn eq(&self, other: &Board) -> bool
[src]
fn eq(&self, other: &Board) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Board) -> bool
[src]
fn ne(&self, other: &Board) -> bool
This method tests for !=
.
impl Default for Board
[src]
impl Default for Board
impl Debug for Board
[src]
impl Debug for Board
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Extend<(Square, Piece)> for Board
[src]
impl Extend<(Square, Piece)> for Board
fn extend<T: IntoIterator<Item = (Square, Piece)>>(&mut self, iter: T)
[src]
fn extend<T: IntoIterator<Item = (Square, Piece)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
impl FromIterator<(Square, Piece)> for Board
[src]
impl FromIterator<(Square, Piece)> for Board
fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = (Square, Piece)>,
[src]
fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = (Square, Piece)>,
Creates a value from an iterator. Read more
impl FromStr for Board
[src]
impl FromStr for Board
type Err = FenError
The associated error which can be returned from parsing.
fn from_str(board_fen: &str) -> Result<Board, FenError>
[src]
fn from_str(board_fen: &str) -> Result<Board, FenError>
Parses a string s
to return a value of this type. Read more
impl Display for Board
[src]
impl Display for Board