#[repr(align(4))]
pub enum Move {
Normal {
role: Role,
from: Square,
capture: Option<Role>,
to: Square,
promotion: Option<Role>,
},
EnPassant {
from: Square,
to: Square,
},
Castle {
king: Square,
rook: Square,
},
Put {
role: Role,
to: Square,
},
}
Expand description
Information about a move.
Variants§
Implementations§
source§impl Move
impl Move
sourcepub const fn to(&self) -> Square
pub const fn to(&self) -> Square
Gets the target square. For castling moves this is the corresponding rook square.
sourcepub const fn is_capture(&self) -> bool
pub const fn is_capture(&self) -> bool
Checks if the move is a capture.
sourcepub const fn is_en_passant(&self) -> bool
pub const fn is_en_passant(&self) -> bool
Checks if the move is en passant.
sourcepub const fn is_zeroing(&self) -> bool
pub const fn is_zeroing(&self) -> bool
Checks if the move zeros the half-move clock.
sourcepub fn castling_side(&self) -> Option<CastlingSide>
pub fn castling_side(&self) -> Option<CastlingSide>
Gets the castling side.
sourcepub const fn is_promotion(&self) -> bool
pub const fn is_promotion(&self) -> bool
Checks if the move is a promotion.
source§impl Move
impl Move
sourcepub fn to_uci(&self, mode: CastlingMode) -> Uci
pub fn to_uci(&self, mode: CastlingMode) -> Uci
See Uci::from_move()
.