implemented checkmate
Some checks failed
pre-release / Pre Release (push) Waiting to run
tagged-release / Tagged Release (push) Has been cancelled

This commit is contained in:
Karma Riuk
2025-01-31 18:19:27 +01:00
parent 496207861e
commit 6c0819428e
11 changed files with 73 additions and 11 deletions

View File

@ -2,7 +2,7 @@ from logic.move import Move
from .piece import Piece
class Queen(Piece):
def legal_moves(self, board: "Board") -> list[Move]:
def legal_moves(self, board: "Board", / , looking_for_check = False) -> list[Move]:
ret = []
# looking north east
@ -29,4 +29,7 @@ class Queen(Piece):
# looking north
ret.extend(self._look_direction(board, 0, 1))
if not looking_for_check and board.is_check_for(self.colour):
return self.keep_only_blocking(ret, board)
return ret