Rename movegen module files and make readability improvements

This commit is contained in:
stefiosif
2024-09-15 11:25:22 +03:00
parent 062a2fe903
commit 6badbcd776
12 changed files with 57 additions and 51 deletions

View File

@@ -2,11 +2,11 @@ use u64 as Bitboard;
use crate::board::bitboard::{have_common_bit, lsb};
use crate::board::state::State;
use crate::movegen::attack::{
use crate::movegen::attack_generator::{
fetch_bishop_attacks, fetch_king_attacks, fetch_knight_attacks, fetch_pawn_attacks,
fetch_queen_attacks, fetch_rook_attacks,
};
use crate::movegen::movegen::{
use crate::movegen::move_generator::{
bishop_pseudo_moves, king_pseudo_moves, knight_pseudo_moves, pawn_pseudo_moves,
queen_pseudo_moves, rook_pseudo_moves,
};
@@ -185,7 +185,7 @@ impl Board {
return Some(at_black);
}
return None;
None
}
pub fn make_move(&mut self, mv: &Move) {
@@ -256,7 +256,7 @@ impl Board {
move_parameters.promoted_piece,
) {
let (own_pieces, opponent_pieces) = self.all_pieces();
opponent_pieces[captured_piece_type].bitboard |= square_to_bitboard(mv.dst);
own_pieces[promoted_piece_type].bitboard &= !square_to_bitboard(mv.dst);
own_pieces[PieceType::Pawn].bitboard |= square_to_bitboard(mv.src);
@@ -474,7 +474,7 @@ impl Color {
mod tests {
use crate::{
board::fen::from_fen,
movegen::{attack::init_attacks, r#move::MoveType},
movegen::{attack_generator::init_attacks, r#move::MoveType},
};
use super::*;