Enum myopic_board::CastleZone [−][src]
pub enum CastleZone { WK, WQ, BK, BQ, }
Represents one of the four different areas on a chessboard where the special castling move can take place (two for each side).
Variants
Implementations
impl CastleZone
[src]
impl CastleZone
[src]pub fn kingside(side: Side) -> CastleZone
[src]
pub fn kingside(side: Side) -> CastleZone
[src]Return the kingside zone for the given side.
pub fn queenside(side: Side) -> CastleZone
[src]
pub fn queenside(side: Side) -> CastleZone
[src]Return the queenside zone for the given side.
pub fn iter() -> impl Iterator<Item = CastleZone>
[src]
pub fn iter() -> impl Iterator<Item = CastleZone>
[src]Create an iterator traversing all zones in order.
pub fn source_squares(self) -> BitBoard
[src]
pub fn source_squares(self) -> BitBoard
[src]Returns a set of exactly two squares which denote the required locations of the king and rook in order for the corresponding castle move to take place.
pub fn rook_data(self) -> (Piece, Square, Square)
[src]
pub fn rook_data(self) -> (Piece, Square, Square)
[src]Returns a triple containing the rook which moves in the corresponding castle move along with it’s required start square followed by the square it will finish on.
pub fn king_data(self) -> (Piece, Square, Square)
[src]
pub fn king_data(self) -> (Piece, Square, Square)
[src]Returns a triple containing the king which moves in the corresponding castle move along with it’s required start square followed by the square it will finish on.
pub fn unoccupied_requirement(self) -> BitBoard
[src]
pub fn unoccupied_requirement(self) -> BitBoard
[src]Returns a set containing the squares which are required to be free of any other pieces in order for the corresponding castle move to be legal.
pub fn uncontrolled_requirement(self) -> BitBoard
[src]
pub fn uncontrolled_requirement(self) -> BitBoard
[src]Returns a set containing the squares which are required to be free of enemy control in order for the corresponding castle move to be legal.
pub fn lift(self) -> EnumSet<CastleZone>
[src]
pub fn lift(self) -> EnumSet<CastleZone>
[src]Lifts this zone to a set of one element.
Trait Implementations
impl<O> BitAnd<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
[src]
impl<O> BitAnd<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
[src]type Output = EnumSet<CastleZone>
type Output = EnumSet<CastleZone>
The resulting type after applying the &
operator.
impl<O> BitOr<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
[src]
impl<O> BitOr<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
[src]type Output = EnumSet<CastleZone>
type Output = EnumSet<CastleZone>
The resulting type after applying the |
operator.
impl<O> BitXor<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
[src]
impl<O> BitXor<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
[src]type Output = EnumSet<CastleZone>
type Output = EnumSet<CastleZone>
The resulting type after applying the ^
operator.
impl Clone for CastleZone
[src]
impl Clone for CastleZone
[src]pub fn clone(&self) -> CastleZone
[src]
pub fn clone(&self) -> CastleZone
[src]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 CastleZone
[src]
impl Debug for CastleZone
[src]impl Display for CastleZone
[src]
impl Display for CastleZone
[src]impl FromStr for CastleZone
[src]
impl FromStr for CastleZone
[src]impl Hash for CastleZone
[src]
impl Hash for CastleZone
[src]impl Not for CastleZone
[src]
impl Not for CastleZone
[src]type Output = EnumSet<CastleZone>
type Output = EnumSet<CastleZone>
The resulting type after applying the !
operator.
impl Ord for CastleZone
[src]
impl Ord for CastleZone
[src]impl PartialEq<CastleZone> for CastleZone
[src]
impl PartialEq<CastleZone> for CastleZone
[src]impl PartialEq<EnumSet<CastleZone>> for CastleZone
[src]
impl PartialEq<EnumSet<CastleZone>> for CastleZone
[src]impl PartialOrd<CastleZone> for CastleZone
[src]
impl PartialOrd<CastleZone> for CastleZone
[src]pub fn partial_cmp(&self, other: &CastleZone) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &CastleZone) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Reflectable for CastleZone
[src]
impl Reflectable for CastleZone
[src]A castle is reflected by it’s side, i.e.
- WK <==> BK
- WQ <==> BQ
pub fn reflect(&self) -> CastleZone
[src]
impl<O> Sub<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
[src]
impl<O> Sub<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
[src]type Output = EnumSet<CastleZone>
type Output = EnumSet<CastleZone>
The resulting type after applying the -
operator.
impl Copy for CastleZone
[src]
impl EnumSetType for CastleZone
[src]
impl Eq for CastleZone
[src]
Auto Trait Implementations
impl RefUnwindSafe for CastleZone
impl Send for CastleZone
impl Sync for CastleZone
impl Unpin for CastleZone
impl UnwindSafe for CastleZone
Blanket Implementations
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut Tⓘ
[src]
pub fn borrow_mut(&mut self) -> &mut Tⓘ
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more