Compare commits
No commits in common. "b3222276abea45deaf5be7bcbd875f32a7de06a6" and "aa3b464bb8e10f6ca67841e5fdc2c4a989c4f4bd" have entirely different histories.
b3222276ab
...
aa3b464bb8
|
@ -14,14 +14,4 @@ impl Iterator for BitboardIterator {
|
|||
Some(crate::board::Square::from_index(lsb))
|
||||
}
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
let size = self.0.count_ones() as usize;
|
||||
|
||||
(size, Some(size))
|
||||
}
|
||||
}
|
||||
|
||||
impl ExactSizeIterator for BitboardIterator {}
|
||||
|
||||
impl std::iter::FusedIterator for BitboardIterator {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use super::{Direction, Rank};
|
||||
use super::Rank;
|
||||
|
||||
/// An enum representing the color of a player.
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
|
@ -65,21 +65,6 @@ impl Color {
|
|||
Self::Black => Rank::Second,
|
||||
}
|
||||
}
|
||||
|
||||
/// Which way do pawns advance for this color.
|
||||
#[inline(always)]
|
||||
pub fn forward_direction(self) -> Direction {
|
||||
match self {
|
||||
Self::White => Direction::North,
|
||||
Self::Black => Direction::South,
|
||||
}
|
||||
}
|
||||
|
||||
/// Which way do the opponent's pawns advance for this color.
|
||||
#[inline(always)]
|
||||
pub fn backward_direction(self) -> Direction {
|
||||
(!self).forward_direction()
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Not for Color {
|
||||
|
|
Loading…
Reference in a new issue