use core::mv::kind::*;
use core::mv::MoveVec;
use super::Position;
pub struct MoveGen<'pos, 'buf> {
pub(super) pos: &'pos Position,
pub(super) buf: &'buf mut MoveVec,
}
impl<'a, 'b> MoveGen<'a, 'b> {
pub fn legal(&mut self) -> &mut Self {
self
}
pub fn castle(&mut self) -> &mut Self {
let all = self.pos.board.all_bits();
for right in self.pos.rights() {
if !all.intersects(right.path()) {
if self.buf.push(Castle::from(right).into()).is_some() {
break;
}
}
}
self
}
}