diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-05-27 18:02:44 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-05-27 18:02:44 +0530 |
| commit | 2c2a70b69869f149c0407a62f1bf4c39899027a7 (patch) | |
| tree | 9c3d194c32e82039fe6e0da9fbaf2e86aeef0a59 /src/engine/moves.h | |
| parent | 58b2c8b6e2041e63c46b579eccc141d21801e985 (diff) | |
restructing
Diffstat (limited to 'src/engine/moves.h')
| -rw-r--r-- | src/engine/moves.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/engine/moves.h b/src/engine/moves.h new file mode 100644 index 0000000..8081ffe --- /dev/null +++ b/src/engine/moves.h @@ -0,0 +1,46 @@ +#ifndef MOVES_H +#define MOVES_H + +#include "ints.h" +#include "bitboard.h" + +typedef u8 square_t; + +typedef struct { + square_t from; + square_t to; +} move_t; +void position_make_move(position_t* position, move_t* move); + +typedef struct { + move_t* moves; + u32 length; + u32 capacity; +} moves_t; + +moves_t moves_init(); +moves_t moves_init_wcapacity(u32 capacity); +moves_t moves_empty(); +void add_move(moves_t* moves, square_t from, square_t to); + +void get_pawn_moves(moves_t* moves, position_t position); +void get_knight_moves(moves_t* moves, position_t position); +void get_king_moves(moves_t* moves, position_t position); +void get_rook_moves(moves_t* moves, position_t position); +void get_bishop_moves(moves_t* moves, position_t position); +void get_queen_moves(moves_t* moves, position_t position); + +void __forloop_rook_moves_gen( + moves_t* moves, + bitboard_t friendly_type, + bitboard_t friendly_pieces, + bitboard_t enemy_pieces +); +void __forloop_bishop_moves_gen( + moves_t* moves, + bitboard_t friendly_type, + bitboard_t friendly_pieces, + bitboard_t enemy_pieces +); + +#endif // !MOVES_H |
