[explorer, moves, position] Implement bespoke make_move and unmake_move methods on Position

Instead of inheriting the MakeMove and UnmakeMove traits by being a BoardProvider,
implement bespoke versions of these two methods. This gives Position a chance to
do some of its own work (tracking captures, move records, etc) when making a move.

Pass the move record by reference to the unmake_move() method. Saves a copy.

Export the Result types for MakeMove and UnmakeMove.
This commit is contained in:
Eryn Wells 2025-06-01 19:02:53 -07:00
parent 724a98c2e2
commit 8f42a4c94e
5 changed files with 66 additions and 45 deletions

View file

@ -8,7 +8,7 @@ use chessfriend_board::{
use chessfriend_core::{Color, Piece, Rank, Square, Wing};
use thiserror::Error;
type MakeMoveResult = Result<MoveRecord, MakeMoveError>;
pub type MakeMoveResult = Result<MoveRecord, MakeMoveError>;
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum ValidateMove {