Enum chess::CastleRights [−][src]
pub enum CastleRights { NoRights, KingSide, QueenSide, Both, }
What castle rights does a particular player have?
Variants
NoRights
KingSide
QueenSide
Both
Methods
impl CastleRights
[src]
impl CastleRights
pub fn has_kingside(&self) -> bool
[src]
pub fn has_kingside(&self) -> bool
Can I castle kingside?
pub fn has_queenside(&self) -> bool
[src]
pub fn has_queenside(&self) -> bool
Can I castle queenside?
ⓘImportant traits for BitBoardpub fn kingside_squares(&self, color: Color) -> BitBoard
[src]
pub fn kingside_squares(&self, color: Color) -> BitBoard
What squares need to be empty to castle kingside?
ⓘImportant traits for BitBoardpub fn queenside_squares(&self, color: Color) -> BitBoard
[src]
pub fn queenside_squares(&self, color: Color) -> BitBoard
What squares need to be empty to castle queenside?
pub fn remove(&self, remove: CastleRights) -> CastleRights
[src]
pub fn remove(&self, remove: CastleRights) -> CastleRights
Remove castle rights, and return a new CastleRights
.
pub fn add(&self, add: CastleRights) -> CastleRights
[src]
pub fn add(&self, add: CastleRights) -> CastleRights
Add some castle rights, and return a new CastleRights
.
pub fn to_index(&self) -> usize
[src]
pub fn to_index(&self) -> usize
Convert CastleRights
to usize
for table lookups
pub fn from_index(i: usize) -> CastleRights
[src]
pub fn from_index(i: usize) -> CastleRights
Convert usize
to CastleRights
. Panic if invalid number.
ⓘImportant traits for BitBoardpub fn unmoved_rooks(&self, color: Color) -> BitBoard
[src]
pub fn unmoved_rooks(&self, color: Color) -> BitBoard
Which rooks can we "guarantee" we haven't moved yet?
pub fn rook_square_to_castle_rights(square: Square) -> CastleRights
[src]
pub fn rook_square_to_castle_rights(square: Square) -> CastleRights
Given a square of a rook, which side is it on? Note: It is invalid to pass in a non-rook square. The code may panic.
Trait Implementations
impl Copy for CastleRights
[src]
impl Copy for CastleRights
impl Clone for CastleRights
[src]
impl Clone for CastleRights
fn clone(&self) -> CastleRights
[src]
fn clone(&self) -> CastleRights
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)
Performs copy-assignment from source
. Read more
impl PartialEq for CastleRights
[src]
impl PartialEq for CastleRights
fn eq(&self, other: &CastleRights) -> bool
[src]
fn eq(&self, other: &CastleRights) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialOrd for CastleRights
[src]
impl PartialOrd for CastleRights
fn partial_cmp(&self, other: &CastleRights) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &CastleRights) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Debug for CastleRights
[src]
impl Debug for CastleRights
Auto Trait Implementations
impl Send for CastleRights
impl Send for CastleRights
impl Sync for CastleRights
impl Sync for CastleRights