[position] Derive several traits for CheckingPieces
Clone, Debug, Eq, and PartialEq.
This commit is contained in:
		
							parent
							
								
									17410936ab
								
							
						
					
					
						commit
						4b35051deb
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -5,6 +5,7 @@ use chessfriend_core::{Color, Direction, Shape, Square};
 | 
			
		|||
 | 
			
		||||
use crate::sight::SliderRayToSquareExt;
 | 
			
		||||
 | 
			
		||||
#[derive(Clone, Debug, Eq, PartialEq)]
 | 
			
		||||
pub struct CheckingPieces {
 | 
			
		||||
    bitboards: [BitBoard; 5],
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -23,7 +24,7 @@ impl CheckingPieces {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    pub fn count(&self) -> u32 {
 | 
			
		||||
        self.bitboards.iter().map(|b| b.population_count()).sum()
 | 
			
		||||
        self.bitboards.iter().map(BitBoard::population_count).sum()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// A BitBoard representing the set of pieces that must be captured to
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue