From f6f19572319fb521c065f662f17bad777e20dda3 Mon Sep 17 00:00:00 2001 From: szymon Date: Sat, 5 Sep 2026 15:53:11 +0200 Subject: [PATCH] fix: formatting again --- src/bin/client.rs | 8 +++---- src/logic/board/board.rs | 43 +++++++++++++++++----------------- src/ui/macroquad/game/board.rs | 30 +++++++++++++----------- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/src/bin/client.rs b/src/bin/client.rs index 9862a4d..95e7585 100644 --- a/src/bin/client.rs +++ b/src/bin/client.rs @@ -72,7 +72,6 @@ struct ClientContext { pub available_moves: Option>, } - async fn run_bot() { let bot = Bot::new(BotDificulty::Easy).await; bot.game_loop().await; @@ -96,10 +95,9 @@ async fn main() -> Result<(), Box> { loop { let mut buffer = String::new(); - if stdin.read_line(&mut buffer).is_ok() - && stdin_sender.blocking_send(buffer).is_err() { - break; - } + if stdin.read_line(&mut buffer).is_ok() && stdin_sender.blocking_send(buffer).is_err() { + break; + } } }); diff --git a/src/logic/board/board.rs b/src/logic/board/board.rs index 95cc1c1..b9e5c80 100644 --- a/src/logic/board/board.rs +++ b/src/logic/board/board.rs @@ -280,31 +280,32 @@ impl Board { if let Some(target) = target_option && self.can_capture(current_pos, target, player, captured_enemies, pawn) - && let Some(path_after_capture) = target.checked_add(direction) { - debug!( - "Found possible capture: {} -> {}", - current_pos, path_after_capture - ); + && let Some(path_after_capture) = target.checked_add(direction) + { + debug!( + "Found possible capture: {} -> {}", + current_pos, path_after_capture + ); - found_any_capture = true; + found_any_capture = true; - let mut new_path = current_path.clone(); - new_path.push(path_after_capture); + let mut new_path = current_path.clone(); + new_path.push(path_after_capture); - let mut new_enemies = captured_enemies.clone(); - new_enemies.push(target); + let mut new_enemies = captured_enemies.clone(); + new_enemies.push(target); - self.find_captures( - start_pos, - path_after_capture, - &mut new_path, - &new_enemies, - available_directions, - player, - all_paths, - pawn, - ); - } + self.find_captures( + start_pos, + path_after_capture, + &mut new_path, + &new_enemies, + available_directions, + player, + all_paths, + pawn, + ); + } } if !found_any_capture && !current_path.is_empty() && !captured_enemies.is_empty() { diff --git a/src/ui/macroquad/game/board.rs b/src/ui/macroquad/game/board.rs index c51f942..7bff631 100644 --- a/src/ui/macroquad/game/board.rs +++ b/src/ui/macroquad/game/board.rs @@ -187,16 +187,17 @@ impl Board { if let Some(field) = &self.get_clicked_field() && let Some(available_moves) = &self.available_moves - && available_moves.iter().any(|available_move| { - available_move.from == from - && available_move.available_steps.contains(&field.pos) - }) { - self.choosen_move = Some(MovePath { - from, - available_steps: vec![field.pos], - }); - self.state = BoardState::View; - } + && available_moves.iter().any(|available_move| { + available_move.from == from + && available_move.available_steps.contains(&field.pos) + }) + { + self.choosen_move = Some(MovePath { + from, + available_steps: vec![field.pos], + }); + self.state = BoardState::View; + } } BoardState::ChooseCapture(from) => { @@ -235,10 +236,11 @@ impl Board { } else { false } - }) { - self.current_capture_path.push(*clicked_field); - self.current_deepness += 1; - } + }) + { + self.current_capture_path.push(*clicked_field); + self.current_deepness += 1; + } if current_highlight.is_empty() { debug!("Capture path complete!");