[][src]Enum shakmaty::variants::VariantPosition

pub enum VariantPosition {
    Chess(Chess),
    Atomic(Atomic),
    Giveaway(Giveaway),
    KingOfTheHill(KingOfTheHill),
    ThreeCheck(ThreeCheck),
    Crazyhouse(Crazyhouse),
    RacingKings(RacingKings),
    Horde(Horde),
}

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]

pub fn swap_turn(self) -> Result<VariantPosition, PositionError>[src]

pub fn variant(&self) -> Variant[src]

Trait Implementations

impl Position for VariantPosition[src]

fn swap_turn(self) -> Result<Self, PositionError> where
    Self: Sized + FromSetup
[src]

Swap turns. This is sometimes called "playing a null move". Read more

fn legals(&self) -> MoveList[src]

Generates legal moves.

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]

Plays a move. Read more

impl Setup for VariantPosition[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]

impl From<Atomic> for VariantPosition[src]

impl From<Giveaway> for VariantPosition[src]

impl From<KingOfTheHill> for VariantPosition[src]

impl From<ThreeCheck> for VariantPosition[src]

impl From<Crazyhouse> for VariantPosition[src]

impl From<RacingKings> for VariantPosition[src]

impl From<Horde> for VariantPosition[src]

impl Clone for 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

Blanket Implementations

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.

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

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

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