Struct shakmaty::Board [−][src]
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: color, role: role }: Piece,
promoted: bool
)
[src]
&mut self,
sq: Square,
Piece { color: color, role: role }: Piece,
promoted: bool
)
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]
&self,
sq: Square,
attacker: Color,
occupied: Bitboard
) -> Bitboard
pub fn pieces(&self) -> Piecesⓘ
[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]
fn extend<T: IntoIterator<Item = (Square, Piece)>>(&mut self, iter: T)
[src]
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[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.
fn from_str(board_fen: &str) -> Result<Board, ParseFenError>
[src]
impl Hash for Board
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Board> for Board
[src]
impl StructuralEq for Board
[src]
impl StructuralPartialEq for Board
[src]
Auto Trait Implementations
impl RefUnwindSafe for Board
impl Send for Board
impl Sync for Board
impl Unpin for Board
impl UnwindSafe for Board
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,