[][src]Struct shakmaty::Board

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()));

Implementations

impl Board[src]

pub fn new() -> Board[src]

pub fn empty() -> Board[src]

pub fn racing_kings() -> Board[src]

pub fn horde() -> Board[src]

pub fn occupied(&self) -> Bitboard[src]

pub fn pawns(&self) -> Bitboard[src]

pub fn knights(&self) -> Bitboard[src]

pub fn bishops(&self) -> Bitboard[src]

pub fn rooks(&self) -> Bitboard[src]

pub fn queens(&self) -> Bitboard[src]

pub fn kings(&self) -> Bitboard[src]

pub fn white(&self) -> Bitboard[src]

pub fn black(&self) -> Bitboard[src]

pub fn promoted(&self) -> Bitboard[src]

pub fn sliders(&self) -> Bitboard[src]

Bishops, rooks and queens.

pub fn steppers(&self) -> Bitboard[src]

Pawns, knights and kings.

pub fn rooks_and_queens(&self) -> Bitboard[src]

pub fn bishops_and_queens(&self) -> Bitboard[src]

pub fn king_of(&self, color: Color) -> Option<Square>[src]

The (unique, unpromoted) king of the given side.

pub fn color_at(&self, sq: Square) -> Option<Color>[src]

pub fn role_at(&self, sq: Square) -> Option<Role>[src]

pub fn piece_at(&self, sq: Square) -> Option<Piece>[src]

pub fn remove_piece_at(&mut self, sq: Square) -> Option<Piece>[src]

pub fn discard_piece_at(&mut self, sq: Square)[src]

pub fn set_piece_at(
    &mut self,
    sq: Square,
    Piece { color, role }: Piece,
    promoted: bool
)
[src]

pub fn by_color(&self, color: Color) -> Bitboard[src]

pub fn by_role(&self, role: Role) -> Bitboard[src]

pub fn by_piece(&self, piece: Piece) -> Bitboard[src]

pub fn attacks_from(&self, sq: Square) -> Bitboard[src]

pub fn attacks_to(
    &self,
    sq: Square,
    attacker: Color,
    occupied: Bitboard
) -> Bitboard
[src]

pub fn pieces(&self) -> Pieces

Notable traits for Pieces

impl Iterator for Pieces type Item = (Square, Piece);
[src]

pub fn material_side(&self, color: Color) -> MaterialSide[src]

pub fn material(&self) -> Material[src]

Trait Implementations

impl Clone for Board[src]

impl Debug for Board[src]

impl Default for Board[src]

impl Display for Board[src]

impl Eq for Board[src]

impl Extend<(Square, Piece)> for Board[src]

impl FromIterator<(Square, Piece)> for Board[src]

impl FromStr for Board[src]

type Err = ParseFenError

The associated error which can be returned from parsing.

impl Hash for Board[src]

impl PartialEq<Board> for Board[src]

impl StructuralEq for Board[src]

impl StructuralPartialEq for Board[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.