[board] A few miscellaneous clean ups in the moves module
This commit is contained in:
		
							parent
							
								
									e4a4477157
								
							
						
					
					
						commit
						ea8f5f47fd
					
				
					 2 changed files with 3 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -7,9 +7,7 @@ use crate::{
 | 
			
		|||
    Move, Position,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
move_generator_declaration!(KnightMoveGenerator, struct);
 | 
			
		||||
move_generator_declaration!(KnightMoveGenerator, new);
 | 
			
		||||
move_generator_declaration!(KnightMoveGenerator, getters);
 | 
			
		||||
move_generator_declaration!(KnightMoveGenerator);
 | 
			
		||||
 | 
			
		||||
impl<'pos> MoveGeneratorInternal for KnightMoveGenerator<'pos> {
 | 
			
		||||
    fn piece(color: Color) -> Piece {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ macro_rules! move_generator_declaration {
 | 
			
		|||
    };
 | 
			
		||||
    ($name:ident, struct) => {
 | 
			
		||||
        pub(super) struct $name<'pos> {
 | 
			
		||||
            position: &'pos Position,
 | 
			
		||||
            position: &'pos crate::Position,
 | 
			
		||||
            color: crate::piece::Color,
 | 
			
		||||
            move_sets: std::collections::BTreeMap<crate::Square, crate::moves::MoveSet>,
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -88,12 +88,5 @@ trait MoveGeneratorInternal {
 | 
			
		|||
        )
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fn move_set_for_piece(position: &Position, placed_piece: PlacedPiece) -> MoveSet {
 | 
			
		||||
        MoveSet::new(placed_piece)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fn move_list_from_bitboard(piece: Piece, square: Square, bitboard: BitBoard) -> Vec<Move> {
 | 
			
		||||
        let map_to_move = |sq| Move::new(piece, square, sq);
 | 
			
		||||
        bitboard.occupied_squares().map(map_to_move).collect()
 | 
			
		||||
    }
 | 
			
		||||
    fn move_set_for_piece(position: &Position, placed_piece: PlacedPiece) -> MoveSet;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue