def is_castle_path_clear(self, move: Move, player_team): spaces_in_between = move.get_spaces_in_between() for space in spaces_in_between: if not self.is_space_safe(space, player_team): return False return True
def is_path_clear(self, move: Move): # Using move's normalization to determine direction ((-1 to 1), (-1 to 1)) spaces_in_between = move.get_spaces_in_between() # print([str(x) for x in spaces_in_between]) # Checking intermediate spaces via normalized Vec2 for space in spaces_in_between: if not self.is_unoccupied(space): # Blocked return False # Not blocked return True