For pawn caputre rays do same as knight rays
This commit is contained in:
@@ -196,18 +196,13 @@ impl PieceType {
|
||||
Color::Black => Dir::Down,
|
||||
Color::White => Dir::Up,
|
||||
};
|
||||
let mut capture_rays = vec![];
|
||||
if let Some(p) = position.chain(&[&direction, &Dir::Left]) {
|
||||
capture_rays.push(Ray {
|
||||
[&[&direction, &Dir::Left], &[&direction, &Dir::Right]]
|
||||
.into_iter()
|
||||
.filter_map(|dirs| position.chain(dirs))
|
||||
.map(|p| Ray {
|
||||
positions: vec![p],
|
||||
});
|
||||
}
|
||||
if let Some(p) = position.chain(&[&direction, &Dir::Right]) {
|
||||
capture_rays.push(Ray {
|
||||
positions: vec![p],
|
||||
});
|
||||
}
|
||||
capture_rays
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
// Knight
|
||||
|
||||
Reference in New Issue
Block a user