Skip to content

Commit 9ba7f73

Browse files
committed
deleted old pseudo legal move generation
1 parent 049e548 commit 9ba7f73

32 files changed

+41
-4230
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#pragma once
2+
3+
#include <bitbishop/attacks/generate_attacks.hpp>
4+
#include <bitbishop/bitboard.hpp>
5+
#include <bitbishop/board.hpp>
6+
#include <bitbishop/color.hpp>
7+
#include <bitbishop/lookups/attackers.hpp>
8+
#include <bitbishop/move.hpp>
9+
#include <bitbishop/movegen/bishop_moves.hpp>
10+
#include <bitbishop/movegen/check_mask.hpp>
11+
#include <bitbishop/movegen/king_moves.hpp>
12+
#include <bitbishop/movegen/knight_moves.hpp>
13+
#include <bitbishop/movegen/pawn_moves.hpp>
14+
#include <bitbishop/movegen/pins.hpp>
15+
#include <bitbishop/movegen/queen_moves.hpp>
16+
#include <bitbishop/movegen/rook_moves.hpp>
17+
#include <vector>
18+
19+
void generate_legal_moves(std::vector<Move> moves, const Board& board, Color us) {
20+
Square king_sq = board.king_square(us).value();
21+
Color them = ColorUtil::opposite(us);
22+
23+
Bitboard checkers = attackers_to(king_sq, them);
24+
Bitboard check_mask = compute_check_mask(king_sq, checkers, board);
25+
PinResult pins = compute_pins(king_sq, board, us);
26+
Bitboard enemy_attacks = generate_attacks(board, them);
27+
28+
generate_legal_king_moves(moves, board, us, king_sq, enemy_attacks, check_mask);
29+
30+
if (checkers.count() > 1) {
31+
return;
32+
}
33+
34+
generate_knight_legal_moves(moves, board, us, check_mask, pins);
35+
generate_bishop_legal_moves(moves, board, us, check_mask, pins);
36+
generate_rook_legal_moves(moves, board, us, check_mask, pins);
37+
generate_queen_legal_moves(moves, board, us, check_mask, pins);
38+
generate_pawn_legal_moves(moves, board, us, king_sq, check_mask, pins);
39+
40+
// TODO generate legal castling moves
41+
}

include/bitbishop/moves/bishop_move_gen.hpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

include/bitbishop/moves/king_move_gen.hpp

Lines changed: 0 additions & 58 deletions
This file was deleted.

include/bitbishop/moves/knight_move_gen.hpp

Lines changed: 0 additions & 26 deletions
This file was deleted.

include/bitbishop/moves/pawn_move_gen.hpp

Lines changed: 0 additions & 202 deletions
This file was deleted.

include/bitbishop/moves/queen_move_gen.hpp

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)