[][src]Enum chess_engine::GameResult

pub enum GameResult {
    Continuing(Board),
    Victory(Color),
    Stalemate,
    IllegalMove(Move),
}

The result of a move being played on the board.

Variants

Continuing(Board)

The game is not finished, and the game is still in play.

Victory(Color)

One player, the victor, checkmated the other. This stores the color of the winner.

Stalemate

The game is drawn. This can be a result of the current player having no legal moves and not being in check, or because both players have insufficient material on the board.

Insufficient material consists of:

  1. The player only has a king
  2. The player only has a king and a knight
  3. The player only has a king and two knights
  4. The player only has a king and a bishop
  5. The player only has a king and two bishops

In a regular game of chess, threefold repetition also triggers a stalemate, but this engine does not have builtin support for threefold repetition detection yet.

IllegalMove(Move)

An illegal move was made. This can include many things, such as moving a piece through another piece, attempting to capture an allied piece, moving non-orthogonally or non-diagonally, or non-knight-like according the rules governing the movement of the piece. Additionally, moves that put the player in check, (for example, moving a pinned piece), are also illegal.

Trait Implementations

impl Clone for GameResult[src]

impl Copy for GameResult[src]

impl Debug for GameResult[src]

impl Eq for GameResult[src]

impl Ord for GameResult[src]

impl PartialEq<GameResult> for GameResult[src]

impl PartialOrd<GameResult> for GameResult[src]

impl StructuralEq for GameResult[src]

impl StructuralPartialEq for GameResult[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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.