[board] Implement PieceSet::iter() as an iterator over its Mailbox
This commit is contained in:
		
							parent
							
								
									fff2e084b5
								
							
						
					
					
						commit
						a14cb30781
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -75,6 +75,10 @@ impl PieceSet {
 | 
				
			||||||
        self.by_color.bitboard(color)
 | 
					        self.by_color.bitboard(color)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pub(crate) fn iter(&self) -> impl Iterator<Item = PlacedPiece> {
 | 
				
			||||||
 | 
					        self.mailbox.iter()
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pub(super) fn bitboard_for_color(&self, color: Color) -> BitBoard {
 | 
					    pub(super) fn bitboard_for_color(&self, color: Color) -> BitBoard {
 | 
				
			||||||
        self.by_color.bitboard(color)
 | 
					        self.by_color.bitboard(color)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue