fixed signature

This commit is contained in:
Karma Riuk 2025-02-02 18:24:23 +01:00
parent da55f0085f
commit fea3f6c98a
2 changed files with 13 additions and 3 deletions

View File

@ -2,14 +2,24 @@
#include "../board.hpp"
std::vector<Move> legal_moves(const Piece p, const Board& b, const Coords xy) {
std::vector<Move> legal_moves(
const Piece p,
const Board& b,
const Coords xy,
bool looking_for_check = false
) {
std::vector<Move> ret;
switch (p) {
case Piece::Pawn:
return pawn_moves(b, xy);
ret = pawn_moves(b, xy);
case Piece::Bishop:
break;
default:
break;
}
if (!looking_for_check)
return keep_only_blocking(ret, b);
return {};
}

View File

@ -23,7 +23,7 @@ enum Colour : int8_t {
class Board;
struct Coords;
std::vector<Move> legal_moves(const Piece, const Board&, const Coords);
std::vector<Move> legal_moves(const Piece, const Board&, const Coords, bool);
std::vector<Move> pawn_moves(const Board&, const Coords);
std::vector<Move> rook_moves(const Board&, const Coords);