Move MoveParameter handling inside make/unmake_move

This commit is contained in:
stefiosif
2024-09-15 17:08:51 +03:00
parent 6badbcd776
commit 3383435af7
5 changed files with 47 additions and 70 deletions

View File

@@ -3,7 +3,15 @@ use String as FenError;
use super::board::{Board, Color};
#[derive(Debug, PartialEq, Eq)]
impl PartialEq for Game {
fn eq(&self, other: &Self) -> bool {
self.board.white_pieces == other.board.white_pieces
&& self.board.black_pieces == other.board.black_pieces
&& self.board.state == other.board.state
}
}
#[derive(Debug, Eq)]
pub struct Game {
pub board: Board,
}
@@ -19,10 +27,6 @@ impl Game {
from_fen(fen)
}
pub const fn run() {
Board::new();
}
pub const fn current_player(&self) -> Color {
self.board.state.current_player()
}