giga-chess 0.8.2

A rust chess library built for performance, handling game logic and legal/best move generation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "bincode", derive(bincode::Encode, bincode::Decode))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum GameStatus {
    Running = 0,
    Stalemate = 1,
    Checkmate = 2,
    DrawFiftyMove = 3,
}

impl GameStatus {
    pub fn is_draw(&self) -> bool {
        match self {
            Self::DrawFiftyMove | Self::Stalemate => true,
            Self::Running | Self::Checkmate => false,
        }
    }
}