Struct shakmaty::Castles [−][src]
pub struct Castles { /* fields omitted */ }
Castling paths and unmoved rooks.
Methods
impl Castles
[src]
impl Castles
pub fn empty() -> Castles
[src]
pub fn empty() -> Castles
pub fn from_setup(setup: &Setup) -> Result<Castles, Castles>
[src]
pub fn from_setup(setup: &Setup) -> Result<Castles, Castles>
pub fn any(&self) -> bool
[src]
pub fn any(&self) -> bool
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
pub fn has(&self, color: Color, side: CastlingSide) -> bool
[src]
pub fn has(&self, color: Color, side: CastlingSide) -> bool
pub fn has_side(&self, color: Color) -> bool
[src]
pub fn has_side(&self, color: Color) -> bool
pub fn discard_rook(&mut self, square: Square)
[src]
pub fn discard_rook(&mut self, square: Square)
pub fn discard_side(&mut self, color: Color)
[src]
pub fn discard_side(&mut self, color: Color)
pub fn rook(&self, color: Color, side: CastlingSide) -> Option<Square>
[src]
pub fn rook(&self, color: Color, side: CastlingSide) -> Option<Square>
pub fn path(&self, color: Color, side: CastlingSide) -> Bitboard
[src]
pub fn path(&self, color: Color, side: CastlingSide) -> Bitboard
Gets the squares that need to be empty so that castling is possible on the given side.
Examples
use shakmaty::{Castles, CastlingSide, Bitboard, Color, Square}; let castles = Castles::default(); let path = castles.path(Color::White, CastlingSide::QueenSide); // . . . . . . . . // . . . . . . . . // . . . . . . . . // . . . . . . . . // . . . . . . . . // . . . . . . . . // . . . . . . . . // 0 1 1 1 0 . . . assert_eq!(path, Bitboard::from(Square::B1) | Bitboard::from(Square::C1) | Bitboard::from(Square::D1));
pub fn castling_rights(&self) -> Bitboard
[src]
pub fn castling_rights(&self) -> Bitboard
pub fn is_chess960(&self) -> bool
[src]
pub fn is_chess960(&self) -> bool
Trait Implementations
impl Clone for Castles
[src]
impl Clone for Castles
fn clone(&self) -> Castles
[src]
fn clone(&self) -> Castles
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 Debug for Castles
[src]
impl Debug for Castles
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 Default for Castles
[src]
impl Default for Castles