From b895eaa265666c43c1a0427b1a693843c85f8603 Mon Sep 17 00:00:00 2001 From: vova-rs Date: Mon, 12 Oct 2026 03:47:14 +0300 Subject: [PATCH] fn status done --- src/chess_api/engines/breakthrough.rs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/chess_api/engines/breakthrough.rs b/src/chess_api/engines/breakthrough.rs index 20c7b62..235b349 100644 --- a/src/chess_api/engines/breakthrough.rs +++ b/src/chess_api/engines/breakthrough.rs @@ -46,20 +46,18 @@ impl ChessEngine for Breakthrough { } fn status(&self) -> GameStatus { - todo!(); - // if self.board.is_mask_zero(0, 0) { - // return GameStatus::Won(Color::White); - // } - // if self.board.is_mask_zero(0, 1) { - // return GameStatus::Won(Color::Black); - // } - // if !self.board.and_mask_is_zero(0, 1, WHITE_WON_ZONE){ - // return GameStatus::Won(Color::White); - // } - // if !self.board.and_mask_is_zero(0, 0, BLACK_WON_ZONE){ - // return GameStatus::Won(Color::Black); - // } - + if self.board.is_mask_zero(Color::White, 0) { + return GameStatus::Won(Color::Black); + } + if self.board.is_mask_zero(Color::Black, 0) { + return GameStatus::Won(Color::White); + } + if !self.board.and_mask_is_zero(Color::Black, 0, BLACK_WON_ZONE) { + return GameStatus::Won(Color::Black); + } + if !self.board.and_mask_is_zero(Color::White, 0, WHITE_WON_ZONE) { + return GameStatus::Won(Color::White); + } GameStatus::Ongoing }