Enum shakmaty::CastlingMode
source · pub enum CastlingMode {
Standard,
Chess960,
}
Expand description
Standard
or Chess960
.
Variants§
Standard
Castling notation and validity requirements for standard chess.
UCI notation describes the king movement, e.g., e1g1
.
Castling rights are only valid for kings and rooks on their own backrank. Kings must be on the e-file. Rooks must be on the a-file or h-file.
Chess960
Castling notation for Chess960 and basic validity requirements.
UCI notation describes a king move to the corresponding rook, e.g.,
e1h1
.
Castling rights are only valid for kings and rooks on their own backrank. Each player can have only one king-side and queen-side castling right respectively.
Beyond the castling rights possible in Chess960 starting positions, the white and black rook files need not be the same. The king can be on any backrank square, including the a/h-file.
Implementations§
source§impl CastlingMode
impl CastlingMode
pub fn detect(setup: &Setup) -> CastlingMode
source§impl CastlingMode
impl CastlingMode
pub const fn from_standard(standard: bool) -> CastlingMode
pub const fn from_chess960(chess960: bool) -> CastlingMode
pub const fn is_standard(self) -> bool
pub const fn is_chess960(self) -> bool
Trait Implementations§
source§impl Clone for CastlingMode
impl Clone for CastlingMode
source§fn clone(&self) -> CastlingMode
fn clone(&self) -> CastlingMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CastlingMode
impl Debug for CastlingMode
source§impl Hash for CastlingMode
impl Hash for CastlingMode
source§impl PartialEq<CastlingMode> for CastlingMode
impl PartialEq<CastlingMode> for CastlingMode
source§fn eq(&self, other: &CastlingMode) -> bool
fn eq(&self, other: &CastlingMode) -> bool
self
and other
values to be equal, and is used
by ==
.