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 }