// TODO: maybe SmallVec
/// History is only used for en passant
maybe SmallVec
History is only used for en passant
maybe SmallVec History is only used for en passant
pub fn valid_positions(
        &self,
        pieces: &[Piece],
        history: &History,
    ) -> Vec<(u8, u8, Option<Takeable>)> {
        let mut poss = Vec::new();
        match self.piece_type {
            PieceType::King => {
                valid_positions_for_king(&mut poss, self, pieces);
            }
            PieceType::Rook => {
                valid_positions_for_rook(&mut poss, self, pieces);
            }
            PieceType::Bishop => {
                valid_positions_for_bishop(&mut poss, self, pieces);
            }
            PieceType::Queen => {
                valid_positions_for_queen(&mut poss, self, pieces);
            }
            PieceType::Knight => {
                valid_positions_for_knight(&mut poss, self, pieces);
            }
            PieceType::Pawn => valid_positions_for_pawn(&mut poss, self, pieces, history),
        }
        poss
    }
pub fn valid_positions ( & self , pieces : & [ Piece ] , history : & History , ) -> Vec < ( u8 , u8 , Option < Takeable > ) > { let mut poss = Vec :: new ( ) ; match self . piece_type { PieceType :: King => { valid_positions_for_king ( & mut poss , self , pieces ) ; } PieceType :: Rook => { valid_positions_for_rook ( & mut poss , self , pieces ) ; } PieceType :: Bishop => { valid_positions_for_bishop ( & mut poss , self , pieces ) ; } PieceType :: Queen => { valid_positions_for_queen ( & mut poss , self , pieces ) ; } PieceType :: Knight => { valid_positions_for_knight ( & mut poss , self , pieces ) ; } PieceType :: Pawn => valid_positions_for_pawn ( & mut poss , self , pieces , history ) , } poss }
TODO: maybe SmallVec
History is only used for en passant
TODO : maybe SmallVec History is only used for en passant
&self
pieces
&[Piece]
history
&History