pub trait ChessEngine {
// Required methods
fn current_mapping(&self) -> &PieceMapping;
fn current_occupied(&self) -> Occupied;
fn current_captured_bits(&self) -> CapturedBits;
fn side_to_move(&self) -> Color;
fn en_passant_target(&self) -> Option<u8>;
fn ply(&self) -> usize;
fn game_result(&self) -> GameResult;
fn read_ply(&self, i: usize) -> Move10;
fn generate_pseudo_legal_moves(&self) -> Vec<Move10>;
fn push_move(&mut self, mv: Move10) -> Result<(), MoveError>;
fn pop_move(&mut self);
fn reset(&mut self);
}
Expand description
The minimal interface a chess engine must provide.
Required Methods§
Sourcefn current_mapping(&self) -> &PieceMapping
fn current_mapping(&self) -> &PieceMapping
Get the current PieceMapping (which piece sits on which square).
Sourcefn current_occupied(&self) -> Occupied
fn current_occupied(&self) -> Occupied
Get the current occupancy bitboard.
Sourcefn current_captured_bits(&self) -> CapturedBits
fn current_captured_bits(&self) -> CapturedBits
Get the current captured‐bits mask.
Sourcefn side_to_move(&self) -> Color
fn side_to_move(&self) -> Color
Return side to move: White or Black.
Sourcefn en_passant_target(&self) -> Option<u8>
fn en_passant_target(&self) -> Option<u8>
Return the current en_passant_target if any.
Sourcefn game_result(&self) -> GameResult
fn game_result(&self) -> GameResult
Return GameResult (Checkmate/Stalemate/Ongoing).
Sourcefn read_ply(&self, i: usize) -> Move10
fn read_ply(&self, i: usize) -> Move10
Return the Move10 code stored at ply index i (0..ply−1).
Sourcefn generate_pseudo_legal_moves(&self) -> Vec<Move10>
fn generate_pseudo_legal_moves(&self) -> Vec<Move10>
Generate all pseudo‐legal moves (Move10) for side_to_move, ignoring self‐check.