[][src]Enum myopic_core::castlezone::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

WK
WQ
BK
BQ

Implementations

impl CastleZone[src]

pub fn kingside(side: Side) -> CastleZone[src]

Return the kingside zone for the given side.

pub fn queenside(side: Side) -> CastleZone[src]

Return the queenside zone for the given side.

pub fn iter() -> impl Iterator<Item = CastleZone>[src]

Create an iterator traversing all zones in order.

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]

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]

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]

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]

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) -> CastleZoneSet[src]

Lifts this zone to a set of one element.

Trait Implementations

impl Clone for CastleZone[src]

impl Copy for CastleZone[src]

impl Debug for CastleZone[src]

impl Eq for CastleZone[src]

impl FromIterator<CastleZone> for CastleZoneSet[src]

impl Hash for CastleZone[src]

impl Ord for CastleZone[src]

impl PartialEq<CastleZone> for CastleZone[src]

impl PartialOrd<CastleZone> for CastleZone[src]

impl Reflectable for CastleZone[src]

A castle is reflected by it's side, i.e.

  • WK <==> BK
  • WQ <==> BQ

impl StructuralEq for CastleZone[src]

impl StructuralPartialEq for CastleZone[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.