[board] Implement Position::move_generator
This commit is contained in:
		
							parent
							
								
									90db9b194f
								
							
						
					
					
						commit
						65a7bec5f9
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -2,6 +2,7 @@
 | 
			
		|||
 | 
			
		||||
use super::Pieces;
 | 
			
		||||
use crate::bitboard::BitBoard;
 | 
			
		||||
use crate::moves::MoveGenerator;
 | 
			
		||||
use crate::piece::{Color, Piece, PiecePlacementError, PlacedPiece, Shape};
 | 
			
		||||
use crate::Square;
 | 
			
		||||
use std::fmt;
 | 
			
		||||
| 
						 | 
				
			
			@ -93,6 +94,10 @@ impl Position {
 | 
			
		|||
        Ok(())
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pub fn move_generator(&self) -> MoveGenerator {
 | 
			
		||||
        MoveGenerator::new(self)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// Return a BitBoard representing the set of squares containing a piece.
 | 
			
		||||
    pub(crate) fn occupied_squares(&self) -> BitBoard {
 | 
			
		||||
        self.pieces_per_color[Color::White as usize] | self.pieces_per_color[Color::Black as usize]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue