pub fn move_candidates(&self, sq: Square, p: Piece) -> Bitboard {
        let bb = match p.piece_type {
            PieceType::Rook => BBFactory::rook_attack(sq, &self.occupied_bb),
            PieceType::Bishop => BBFactory::bishop_attack(sq, &self.occupied_bb),
            PieceType::Lance => BBFactory::lance_attack(p.color, sq, &self.occupied_bb),
            PieceType::ProRook => {
                &BBFactory::rook_attack(sq, &self.occupied_bb)
                    | &BBFactory::attacks_from(PieceType::King, p.color, sq)
            }
            PieceType::ProBishop => {
                &BBFactory::bishop_attack(sq, &self.occupied_bb)
                    | &BBFactory::attacks_from(PieceType::King, p.color, sq)
            }
            PieceType::ProSilver
            | PieceType::ProKnight
            | PieceType::ProLance
            | PieceType::ProPawn => BBFactory::attacks_from(PieceType::Gold, p.color, sq),
            pt => BBFactory::attacks_from(pt, p.color, sq),
        };

        &bb & &!&self.color_bb[p.color.index()]
    }
/// Returns a list of squares to where the given pieve at the given square can move.
Returns a list of squares to where the given pieve at the given square can move.
Returns a list of squares to where the given pieve at the given square can move .
pub fn move_candidates(&self, sq: Square, p: Piece) -> Bitboard {
        let bb = match p.piece_type {
            PieceType::Rook => BBFactory::rook_attack(sq, &self.occupied_bb),
            PieceType::Bishop => BBFactory::bishop_attack(sq, &self.occupied_bb),
            PieceType::Lance => BBFactory::lance_attack(p.color, sq, &self.occupied_bb),
            PieceType::ProRook => {
                &BBFactory::rook_attack(sq, &self.occupied_bb)
                    | &BBFactory::attacks_from(PieceType::King, p.color, sq)
            }
            PieceType::ProBishop => {
                &BBFactory::bishop_attack(sq, &self.occupied_bb)
                    | &BBFactory::attacks_from(PieceType::King, p.color, sq)
            }
            PieceType::ProSilver
            | PieceType::ProKnight
            | PieceType::ProLance
            | PieceType::ProPawn => BBFactory::attacks_from(PieceType::Gold, p.color, sq),
            pt => BBFactory::attacks_from(pt, p.color, sq),
        };
        &bb & &!&self.color_bb[p.color.index()]
    }
pub fn move_candidates ( & self , sq : Square , p : Piece ) -> Bitboard { let bb = match p . piece_type { PieceType :: Rook => BBFactory :: rook_attack ( sq , & self . occupied_bb ) , PieceType :: Bishop => BBFactory :: bishop_attack ( sq , & self . occupied_bb ) , PieceType :: Lance => BBFactory :: lance_attack ( p . color , sq , & self . occupied_bb ) , PieceType :: ProRook => { & BBFactory :: rook_attack ( sq , & self . occupied_bb ) | & BBFactory :: attacks_from ( PieceType :: King , p . color , sq ) } PieceType :: ProBishop => { & BBFactory :: bishop_attack ( sq , & self . occupied_bb ) | & BBFactory :: attacks_from ( PieceType :: King , p . color , sq ) } PieceType :: ProSilver | PieceType :: ProKnight | PieceType :: ProLance | PieceType :: ProPawn => BBFactory :: attacks_from ( PieceType :: Gold , p . color , sq ) , pt => BBFactory :: attacks_from ( pt , p . color , sq ) , } ; & bb & & ! & self . color_bb [ p . color . index ( ) ] }
Returns a list of squares to where the given pieve at the given square can move.
Returns a list of squares to where the given pieve at the given square can move .
&self
sq
Square
p
Piece