pub enum GameResult {
Continuing(Board),
Victory(Color),
Stalemate,
IllegalMove(Move),
}
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.
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:
- 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.
Trait Implementations§
Source§impl Clone for GameResult
impl Clone for GameResult
Source§fn clone(&self) -> GameResult
fn clone(&self) -> GameResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more