Enum myopic_core::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: Into<EnumSet<CastleZone>>> BitAnd<O> for CastleZone
[src]
impl<O: Into<EnumSet<CastleZone>>> BitAnd<O> for CastleZone
[src]impl<O: Into<EnumSet<CastleZone>>> BitOr<O> for CastleZone
[src]
impl<O: Into<EnumSet<CastleZone>>> BitOr<O> for CastleZone
[src]impl<O: Into<EnumSet<CastleZone>>> BitXor<O> for CastleZone
[src]
impl<O: Into<EnumSet<CastleZone>>> BitXor<O> for CastleZone
[src]impl Clone for CastleZone
[src]
impl Clone for CastleZone
[src]impl Debug for CastleZone
[src]
impl Debug for CastleZone
[src]impl Display for CastleZone
[src]
impl Display for CastleZone
[src]impl EnumSetTypePrivate for CastleZone
[src]
impl EnumSetTypePrivate for CastleZone
[src]fn enum_into_u32(self) -> u32
[src]
fn enum_into_u32(self) -> u32
[src]Converts an enum of this type into its bit position.
unsafe fn enum_from_u32(val: u32) -> Self
[src]
unsafe fn enum_from_u32(val: u32) -> Self
[src]Converts a bit position into an enum value.
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]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]fn partial_cmp(&self, other: &CastleZone) -> Option<Ordering>
[src]
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
impl<O: Into<EnumSet<CastleZone>>> Sub<O> for CastleZone
[src]
impl<O: Into<EnumSet<CastleZone>>> Sub<O> for CastleZone
[src]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> 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