wip: introduce MoveSet
This commit is contained in:
parent
42ccddc12b
commit
a8b7b9ca63
2 changed files with 245 additions and 209 deletions
14
src/moves.rs
14
src/moves.rs
|
|
@ -120,11 +120,8 @@ impl<'l> Move<'l> {
|
|||
self.to
|
||||
}
|
||||
#[inline]
|
||||
fn extend<I>(&mut self, iter: I) -> ControlFlow<Infallible>
|
||||
where
|
||||
I: Iterator<Item = RawMove> + ExactSizeIterator,
|
||||
{
|
||||
iter.for_each(|raw| {
|
||||
fn extend(&mut self, s: MoveSet) -> ControlFlow<Infallible> {
|
||||
s.for_each(|raw| {
|
||||
debug_assert!(raw.role() as u8 == ROLE);
|
||||
debug_assert!(self.to.contains(raw.to()));
|
||||
self.candidates.insert(raw.from);
|
||||
|
|
@ -236,11 +233,8 @@ impl<'l> MoveGen<Infallible> for Moves<'l> {
|
|||
ControlFlow::Continue(())
|
||||
}
|
||||
#[inline]
|
||||
fn extend<I>(&mut self, iter: I) -> ControlFlow<Infallible>
|
||||
where
|
||||
I: Iterator<Item = RawMove> + ExactSizeIterator,
|
||||
{
|
||||
iter.for_each(|raw| unsafe { self.array.push_unchecked(raw) });
|
||||
fn extend(&mut self, s: MoveSet) -> ControlFlow<Infallible> {
|
||||
s.for_each(|raw| unsafe { self.array.push_unchecked(raw) });
|
||||
ControlFlow::Continue(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue