2025-02-06 16:15:56 +01:00
|
|
|
#include "../board/board.hpp"
|
|
|
|
#include "../utils/coords.hpp"
|
|
|
|
#include "../utils/move.hpp"
|
2025-02-02 20:17:36 +01:00
|
|
|
#include "piece.hpp"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
std::vector<Move> bishop_moves(const Board& b, const Coords xy) {
|
|
|
|
std::vector<Move> ret;
|
|
|
|
auto ne = look_direction(b, xy, 1, 1);
|
|
|
|
ret.insert(ret.end(), ne.begin(), ne.end());
|
|
|
|
|
|
|
|
auto se = look_direction(b, xy, 1, -1);
|
|
|
|
ret.insert(ret.end(), se.begin(), se.end());
|
|
|
|
|
|
|
|
auto sw = look_direction(b, xy, -1, -1);
|
|
|
|
ret.insert(ret.end(), sw.begin(), sw.end());
|
|
|
|
|
|
|
|
auto nw = look_direction(b, xy, -1, 1);
|
|
|
|
ret.insert(ret.end(), nw.begin(), nw.end());
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|