Skip to content

Commit

Permalink
Update uci_connection.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
tigerros committed Sep 23, 2024
1 parent cee5e3e commit b65030e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/uci_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl EngineConnection {
message: GoMessage,
) -> io::Result<(Vec<Box<InfoMessage>>, BestMoveMessage)> {
let message_depth = message.depth;

self.send_message(&GuiMessage::Go(message)).await?;

let mut info_messages = Vec::<Box<InfoMessage>>::with_capacity(
Expand All @@ -229,11 +229,12 @@ impl EngineConnection {
}
}
}

/// Equivalent to the [`go`] function, but doesn't store a vec of info messages, instead just returning the last one.

/// Equivalent to the [`go`] function, but doesn't store a vector of info messages,
/// and returns only the last one instead.
pub async fn go_only_last_info(&mut self, message: GoMessage) -> io::Result<(Option<InfoMessage>, BestMoveMessage)> {
self.send_message(&GuiMessage::Go(message)).await?;

let mut last_info_message = None;

loop {
Expand Down

0 comments on commit b65030e

Please sign in to comment.