apparently the default value of a paramter goes in

the declaration and not the defintion, i didn't know that
This commit is contained in:
Karma Riuk 2025-02-03 00:08:13 +01:00
parent 8da349579d
commit fa57dcfc30
2 changed files with 3 additions and 4 deletions

View File

@ -18,9 +18,8 @@ keep_only_blocking(const std::vector<Move> candidates, const Board& board) {
return ret; return ret;
} }
std::vector<Move> legal_moves( std::vector<Move>
int8_t p, const Board& b, const Coords xy, bool looking_for_check = false legal_moves(int8_t p, const Board& b, const Coords xy, bool looking_for_check) {
) {
std::vector<Move> ret; std::vector<Move> ret;
switch (p) { switch (p) {
case Piece::Pawn: case Piece::Pawn:

View File

@ -24,7 +24,7 @@ enum Colour : int8_t {
class Board; class Board;
struct Coords; struct Coords;
std::vector<Move> legal_moves(int8_t, const Board&, const Coords, bool); std::vector<Move> legal_moves(int8_t, const Board&, const Coords, bool = false);
std::vector<Move> keep_only_blocking(const std::vector<Move>, const Board&); std::vector<Move> keep_only_blocking(const std::vector<Move>, const Board&);
std::optional<Move> move_for_position(const Board&, const Coords, const Coords); std::optional<Move> move_for_position(const Board&, const Coords, const Coords);
std::vector<Move> look_direction(const Board&, const Coords, int, int); std::vector<Move> look_direction(const Board&, const Coords, int, int);