Struct shakmaty::variant::Crazyhouse
source · pub struct Crazyhouse { /* private fields */ }
Available on crate feature
variant
only.Expand description
A Crazyhouse position.
Implementations§
source§impl Crazyhouse
impl Crazyhouse
pub const fn new() -> Crazyhouse
Trait Implementations§
source§impl Clone for Crazyhouse
impl Clone for Crazyhouse
source§fn clone(&self) -> Crazyhouse
fn clone(&self) -> Crazyhouse
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Crazyhouse
impl Debug for Crazyhouse
source§impl Default for Crazyhouse
impl Default for Crazyhouse
source§fn default() -> Crazyhouse
fn default() -> Crazyhouse
Returns the “default value” for a type. Read more
source§impl From<Crazyhouse> for VariantPosition
impl From<Crazyhouse> for VariantPosition
source§fn from(pos: Crazyhouse) -> VariantPosition
fn from(pos: Crazyhouse) -> VariantPosition
Converts to this type from the input type.
source§impl FromSetup for Crazyhouse
impl FromSetup for Crazyhouse
source§fn from_setup(
setup: Setup,
mode: CastlingMode
) -> Result<Crazyhouse, PositionError<Crazyhouse>>
fn from_setup( setup: Setup, mode: CastlingMode ) -> Result<Crazyhouse, PositionError<Crazyhouse>>
source§impl Hash for Crazyhouse
impl Hash for Crazyhouse
source§impl PartialEq for Crazyhouse
impl PartialEq for Crazyhouse
source§fn eq(&self, other: &Crazyhouse) -> bool
fn eq(&self, other: &Crazyhouse) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Position for Crazyhouse
impl Position for Crazyhouse
source§fn promoted(&self) -> Bitboard
fn promoted(&self) -> Bitboard
Positions of tracked promoted pieces. Used only for Crazyhouse.
source§fn maybe_ep_square(&self) -> Option<Square>
fn maybe_ep_square(&self) -> Option<Square>
Unconditionally gets the en passant target
square after a double pawn push, even if no en passant capture is
actually possible. Read more
source§fn remaining_checks(&self) -> Option<&ByColor<RemainingChecks>>
fn remaining_checks(&self) -> Option<&ByColor<RemainingChecks>>
Remaining checks in Three-Check.
source§fn halfmoves(&self) -> u32
fn halfmoves(&self) -> u32
Number of half-moves since the last
capture or pawn move.
source§fn fullmoves(&self) -> NonZeroU32
fn fullmoves(&self) -> NonZeroU32
Move number. Starts at 1 and is increased after every black move.
source§fn into_setup(self, mode: EnPassantMode) -> Setup
fn into_setup(self, mode: EnPassantMode) -> Setup
Converts the position to the current
Setup
.source§fn play_unchecked(&mut self, m: &Move)
fn play_unchecked(&mut self, m: &Move)
Plays a move. It is the callers responsibility to ensure the move is
legal. Read more
source§fn legal_moves(&self) -> MoveList
fn legal_moves(&self) -> MoveList
Generates all legal moves.
source§fn castling_moves(&self, side: CastlingSide) -> MoveList
fn castling_moves(&self, side: CastlingSide) -> MoveList
Generates legal castling moves.
source§fn en_passant_moves(&self) -> MoveList
fn en_passant_moves(&self) -> MoveList
Generates en passant moves.
source§fn san_candidates(&self, role: Role, to: Square) -> MoveList
fn san_candidates(&self, role: Role, to: Square) -> MoveList
Generates a subset of legal moves: All piece moves and drops of type
role
to the square to
, excluding castling moves.source§fn has_insufficient_material(&self, _color: Color) -> bool
fn has_insufficient_material(&self, _color: Color) -> bool
Tests if a side has insufficient winning material. Read more
source§fn is_variant_end(&self) -> bool
fn is_variant_end(&self) -> bool
Checks if the game is over due to a special variant end condition. Read more
source§fn variant_outcome(&self) -> Option<Outcome>
fn variant_outcome(&self) -> Option<Outcome>
Tests special variant winning, losing and drawing conditions.
source§fn capture_moves(&self) -> MoveList
fn capture_moves(&self) -> MoveList
Generates capture moves.
source§fn promotion_moves(&self) -> MoveList
fn promotion_moves(&self) -> MoveList
Generate promotion moves.
source§fn king_attackers(
&self,
square: Square,
attacker: Color,
occupied: Bitboard
) -> Bitboard
fn king_attackers( &self, square: Square, attacker: Color, occupied: Bitboard ) -> Bitboard
Attacks that a king on
square
would have to deal with.source§fn our(&self, role: Role) -> Bitboard
fn our(&self, role: Role) -> Bitboard
Squares occupied with the given piece type by the side to move.
source§fn their(&self, role: Role) -> Bitboard
fn their(&self, role: Role) -> Bitboard
Squares occupied with the given piece type by the opponent of the side
to move.
source§fn pseudo_legal_ep_square(&self) -> Option<Square>
fn pseudo_legal_ep_square(&self) -> Option<Square>
The en passant square, if it is the target of a
pseudo-legal en passant move.
source§fn legal_ep_square(&self) -> Option<Square>
fn legal_ep_square(&self) -> Option<Square>
The en passant square, if it really is the target of a
legal en passant
move.
source§fn is_checkmate(&self) -> bool
fn is_checkmate(&self) -> bool
Tests for checkmate.
source§fn is_stalemate(&self) -> bool
fn is_stalemate(&self) -> bool
Tests for stalemate.
source§fn is_insufficient_material(&self) -> bool
fn is_insufficient_material(&self) -> bool
Tests if both sides
have insufficient winning material.
source§fn is_game_over(&self) -> bool
fn is_game_over(&self) -> bool
source§fn outcome(&self) -> Option<Outcome>
fn outcome(&self) -> Option<Outcome>
The outcome of the game, or
None
if the game is not over.impl Eq for Crazyhouse
impl StructuralPartialEq for Crazyhouse
Auto Trait Implementations§
impl Freeze for Crazyhouse
impl RefUnwindSafe for Crazyhouse
impl Send for Crazyhouse
impl Sync for Crazyhouse
impl Unpin for Crazyhouse
impl UnwindSafe for Crazyhouse
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<P> ZobristHash for Pwhere
P: Position,
impl<P> ZobristHash for Pwhere
P: Position,
source§fn zobrist_hash<V>(&self, mode: EnPassantMode) -> Vwhere
V: ZobristValue,
fn zobrist_hash<V>(&self, mode: EnPassantMode) -> Vwhere
V: ZobristValue,
Computes the Zobrist hash of the position from scratch. The hash
includes the position, except halfmove clock and fullmove number.