Move naive move generation into sub-module

This commit is contained in:
Bruno BELANYI 2022-07-24 16:24:35 +02:00
parent 8289204e4b
commit bd43535192
10 changed files with 14 additions and 13 deletions

View file

@ -7,9 +7,11 @@ pub mod utils;
use crate::{
board::{Bitboard, Color, File, Square},
movegen::{
king::king_moves,
knight::knight_moves,
pawn::{pawn_captures, pawn_moves},
naive::{
king::king_moves,
knight::knight_moves,
pawn::{pawn_captures, pawn_moves},
},
wizardry::generation::{generate_bishop_magics, generate_rook_magics},
Magic,
},

View file

@ -2,12 +2,8 @@
pub mod magic;
pub use magic::*;
// Move generation implementation details
pub(crate) mod bishop;
pub(crate) mod king;
pub(crate) mod knight;
pub(crate) mod pawn;
pub(crate) mod rook;
// Naive move generation
pub mod naive;
// Magic bitboard generation
pub(crate) mod wizardry;

5
src/movegen/naive/mod.rs Normal file
View file

@ -0,0 +1,5 @@
pub mod bishop;
pub mod king;
pub mod knight;
pub mod pawn;
pub mod rook;

View file

@ -1,6 +1,5 @@
use crate::board::{Bitboard, Square};
use crate::movegen::bishop::bishop_moves;
use crate::movegen::rook::rook_moves;
use crate::movegen::naive::{bishop::bishop_moves, rook::rook_moves};
use crate::movegen::Magic;
use super::mask::{generate_bishop_mask, generate_rook_mask};

View file

@ -1,6 +1,5 @@
use crate::board::{Bitboard, File, Rank, Square};
use crate::movegen::bishop::bishop_moves;
use crate::movegen::rook::rook_moves;
use crate::movegen::naive::{bishop::bishop_moves, rook::rook_moves};
pub fn generate_bishop_mask(square: Square) -> Bitboard {
let rays = bishop_moves(square, Bitboard::EMPTY);