diff --git a/chess_uci/src/lib.rs b/chess_uci/src/lib.rs index 5f00a53..46b921b 100644 --- a/chess_uci/src/lib.rs +++ b/chess_uci/src/lib.rs @@ -91,9 +91,14 @@ impl UciEngine { /// /// uci.make_move(ChessMove::from_str("e2e4").expect("error converting e2e4")); /// ``` - pub fn make_move(&mut self, chess_move: ChessMove) { - self.game.make_move(chess_move); - self.push(GuiCommand::Position { position: Some(self.initial), moves: self.game.actions().to_vec() }) + pub fn make_move(&mut self, chess_move: ChessMove) -> bool { + if self.game.make_move(chess_move) { + self.push(GuiCommand::Position { position: Some(self.initial), moves: self.game.actions().to_vec() }); + true + } else { + false + } + }