Enum myopic_brain::CastleZone [−]
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
impl CastleZone
pub fn kingside(side: Side) -> CastleZone
pub fn kingside(side: Side) -> CastleZone
Return the kingside zone for the given side.
pub fn queenside(side: Side) -> CastleZone
pub fn queenside(side: Side) -> CastleZone
Return the queenside zone for the given side.
pub fn iter() -> impl Iterator<Item = CastleZone>
pub fn iter() -> impl Iterator<Item = CastleZone>
Create an iterator traversing all zones in order.
pub fn source_squares(self) -> BitBoard
pub fn source_squares(self) -> BitBoard
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)
pub fn rook_data(self) -> (Piece, Square, Square)
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)
pub fn king_data(self) -> (Piece, Square, Square)
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
pub fn unoccupied_requirement(self) -> BitBoard
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
pub fn uncontrolled_requirement(self) -> BitBoard
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>
pub fn lift(self) -> EnumSet<CastleZone>
Lifts this zone to a set of one element.
Trait Implementations
impl<O> BitAnd<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
impl<O> BitAnd<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
type Output = EnumSet<CastleZone>
type Output = EnumSet<CastleZone>
The resulting type after applying the &
operator.
pub fn bitand(self, other: O) -> <CastleZone as BitAnd<O>>::Output
pub fn bitand(self, other: O) -> <CastleZone as BitAnd<O>>::Output
Performs the &
operation. Read more
impl<O> BitOr<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
impl<O> BitOr<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
type Output = EnumSet<CastleZone>
type Output = EnumSet<CastleZone>
The resulting type after applying the |
operator.
pub fn bitor(self, other: O) -> <CastleZone as BitOr<O>>::Output
pub fn bitor(self, other: O) -> <CastleZone as BitOr<O>>::Output
Performs the |
operation. Read more
impl<O> BitXor<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
impl<O> BitXor<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
type Output = EnumSet<CastleZone>
type Output = EnumSet<CastleZone>
The resulting type after applying the ^
operator.
pub fn bitxor(self, other: O) -> <CastleZone as BitXor<O>>::Output
pub fn bitxor(self, other: O) -> <CastleZone as BitXor<O>>::Output
Performs the ^
operation. Read more
impl Clone for CastleZone
impl Clone for CastleZone
pub fn clone(&self) -> CastleZone
pub fn clone(&self) -> CastleZone
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
impl Debug for CastleZone
impl Display for CastleZone
impl Display for CastleZone
impl FromStr for CastleZone
impl FromStr for CastleZone
pub fn from_str(s: &str) -> Result<CastleZone, <CastleZone as FromStr>::Err>
pub fn from_str(s: &str) -> Result<CastleZone, <CastleZone as FromStr>::Err>
Parses a string s
to return a value of this type. Read more
impl Hash for CastleZone
impl Hash for CastleZone
impl Not for CastleZone
impl Not for CastleZone
type Output = EnumSet<CastleZone>
type Output = EnumSet<CastleZone>
The resulting type after applying the !
operator.
pub fn not(self) -> <CastleZone as Not>::Output
pub fn not(self) -> <CastleZone as Not>::Output
Performs the unary !
operation. Read more
impl Ord for CastleZone
impl Ord for CastleZone
impl PartialEq<CastleZone> for CastleZone
impl PartialEq<CastleZone> for CastleZone
impl PartialEq<EnumSet<CastleZone>> for CastleZone
impl PartialEq<EnumSet<CastleZone>> for CastleZone
impl PartialOrd<CastleZone> for CastleZone
impl PartialOrd<CastleZone> for CastleZone
pub fn partial_cmp(&self, other: &CastleZone) -> Option<Ordering>
pub fn partial_cmp(&self, other: &CastleZone) -> Option<Ordering>
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
impl Reflectable for CastleZone
A castle is reflected by it’s side, i.e.
- WK <==> BK
- WQ <==> BQ
pub fn reflect(&self) -> CastleZone
impl<O> Sub<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
impl<O> Sub<O> for CastleZone where
O: Into<EnumSet<CastleZone>>,
type Output = EnumSet<CastleZone>
type Output = EnumSet<CastleZone>
The resulting type after applying the -
operator.
pub fn sub(self, other: O) -> <CastleZone as Sub<O>>::Output
pub fn sub(self, other: O) -> <CastleZone as Sub<O>>::Output
Performs the -
operation. Read more
impl Copy for CastleZone
impl EnumSetType for CastleZone
impl Eq for CastleZone
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