Enum chess_engine::GameResult [−][src]
Expand description
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.
Tuple Fields of Continuing
0: Board
Victory(Color)
One player, the victor, checkmated the other. This stores the color of the winner.
Tuple Fields of Victory
0: Color
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:
- The player only has a king
- The player only has a king and a knight
- The player only has a king and two knights
- The player only has a king and a bishop
- 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.
Tuple Fields of IllegalMove
0: Move
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for GameResult
impl Send for GameResult
impl Sync for GameResult
impl Unpin for GameResult
impl UnwindSafe for GameResult
Blanket Implementations
Mutably borrows from an owned value. Read more