[−][src]Enum shakmaty::variants::VariantPosition
Dynamically dispatched chess variant Position
.
Variants
Chess(Chess)
Atomic(Atomic)
Giveaway(Giveaway)
KingOfTheHill(KingOfTheHill)
ThreeCheck(ThreeCheck)
Crazyhouse(Crazyhouse)
RacingKings(RacingKings)
Horde(Horde)
Methods
impl VariantPosition
[src]
pub fn new(variant: Variant) -> VariantPosition
[src]
pub fn from_setup(
variant: Variant,
setup: &dyn Setup
) -> Result<VariantPosition, PositionError>
[src]
variant: Variant,
setup: &dyn Setup
) -> Result<VariantPosition, PositionError>
pub fn swap_turn(self) -> Result<VariantPosition, PositionError>
[src]
pub fn variant(&self) -> Variant
[src]
Trait Implementations
impl Position for VariantPosition
[src]
fn legal_moves(&self, moves: &mut MoveList)
[src]
fn san_candidates(&self, role: Role, to: Square, moves: &mut MoveList)
[src]
fn castling_moves(&self, side: CastlingSide, moves: &mut MoveList)
[src]
fn en_passant_moves(&self, moves: &mut MoveList)
[src]
fn capture_moves(&self, moves: &mut MoveList)
[src]
fn promotion_moves(&self, moves: &mut MoveList)
[src]
fn is_irreversible(&self, m: &Move) -> bool
[src]
fn king_attackers(
&self,
square: Square,
attacker: Color,
occupied: Bitboard
) -> Bitboard
[src]
&self,
square: Square,
attacker: Color,
occupied: Bitboard
) -> Bitboard
fn castles(&self) -> &Castles
[src]
fn checkers(&self) -> Bitboard
[src]
fn is_variant_end(&self) -> bool
[src]
fn has_insufficient_material(&self, color: Color) -> bool
[src]
fn variant_outcome(&self) -> Option<Outcome>
[src]
fn play_unchecked(&mut self, m: &Move)
[src]
fn swap_turn(self) -> Result<Self, PositionError> where
Self: Sized + FromSetup,
[src]
Self: Sized + FromSetup,
Swap turns. This is sometimes called "playing a null move". Read more
fn legals(&self) -> MoveList
[src]
Generates legal moves.
fn is_legal(&self, m: &Move) -> bool
[src]
Tests a move for legality.
fn is_check(&self) -> bool
[src]
Tests if the king is in check.
fn is_checkmate(&self) -> bool
[src]
Tests for checkmate.
fn is_stalemate(&self) -> bool
[src]
Tests for stalemate.
fn is_insufficient_material(&self) -> bool
[src]
Tests if both sides have insufficient winning material. Read more
fn is_game_over(&self) -> bool
[src]
Tests if the game is over due to checkmate, stalemate, insufficient material or variant end. Read more
fn outcome(&self) -> Option<Outcome>
[src]
The outcome of the game, or None
if the game is not over.
fn play(self, m: &Move) -> Result<Self, IllegalMoveError> where
Self: Sized,
[src]
Self: Sized,
Plays a move. Read more
impl Setup for VariantPosition
[src]
fn board(&self) -> &Board
[src]
fn pockets(&self) -> Option<&Material>
[src]
fn turn(&self) -> Color
[src]
fn castling_rights(&self) -> Bitboard
[src]
fn ep_square(&self) -> Option<Square>
[src]
fn remaining_checks(&self) -> Option<&RemainingChecks>
[src]
fn halfmoves(&self) -> u32
[src]
fn fullmoves(&self) -> u32
[src]
fn us(&self) -> Bitboard
[src]
Squares occupied by the side to move. Read more
fn our(&self, role: Role) -> Bitboard
[src]
Squares occupied by a given piece type of the side to move. Read more
fn them(&self) -> Bitboard
[src]
Squares occupied by the waiting player. Read more
fn their(&self, role: Role) -> Bitboard
[src]
Squares occupied by a given piece type of the waiting player. Read more
impl From<Chess> for VariantPosition
[src]
fn from(pos: Chess) -> VariantPosition
[src]
impl From<Atomic> for VariantPosition
[src]
fn from(pos: Atomic) -> VariantPosition
[src]
impl From<Giveaway> for VariantPosition
[src]
fn from(pos: Giveaway) -> VariantPosition
[src]
impl From<KingOfTheHill> for VariantPosition
[src]
fn from(pos: KingOfTheHill) -> VariantPosition
[src]
impl From<ThreeCheck> for VariantPosition
[src]
fn from(pos: ThreeCheck) -> VariantPosition
[src]
impl From<Crazyhouse> for VariantPosition
[src]
fn from(pos: Crazyhouse) -> VariantPosition
[src]
impl From<RacingKings> for VariantPosition
[src]
fn from(pos: RacingKings) -> VariantPosition
[src]
impl From<Horde> for VariantPosition
[src]
fn from(pos: Horde) -> VariantPosition
[src]
impl Clone for VariantPosition
[src]
fn clone(&self) -> VariantPosition
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for VariantPosition
[src]
Auto Trait Implementations
impl Unpin for VariantPosition
impl Send for VariantPosition
impl Sync for VariantPosition
impl UnwindSafe for VariantPosition
impl RefUnwindSafe for VariantPosition
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,