fmt: reformatted code, changed some function signatures, fairly minor

This commit is contained in:
A.M. Rowsell 2025-08-29 04:17:16 -04:00
commit 21fae88bdb
Signed by untrusted user who does not match committer: amr
GPG key ID: E0879EDBDB0CA7B1
5 changed files with 216 additions and 50 deletions

View file

@ -18,11 +18,11 @@ Piece::~Piece() {
// so this is just a stub that does nothing. it doesn't matter
// because only the derived class versions should be called.
std::vector<Move> Piece::getLegalMoves(const Square &from, const Board &board) const {
std::vector<Move> Piece::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList;
return moveList;
}
bool King::checkForCheck() const {
bool King::checkForCheck(Board &board) const {
std::vector<std::vector<int>> kingVulnerable = {
{-1, 0}, // Up
{-1, -1}, // up-left
@ -45,7 +45,7 @@ bool King::checkForCheck() const {
return inCheck;
}
std::vector<Move> King::getLegalMoves(const Square &from, const Board &board) const {
std::vector<Move> King::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList;
std::vector<std::vector<int>> directions = {
{-1, 0}, // Up
@ -156,7 +156,7 @@ std::vector<Move> King::getLegalMoves(const Square &from, const Board &board) co
return moveList;
}
std::vector<Move> Rook::getLegalMoves(const Square &from, const Board &board) const {
std::vector<Move> Rook::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList;
const int directions[4][2] = {
{-1, 0}, // Up
@ -186,22 +186,22 @@ std::vector<Move> Rook::getLegalMoves(const Square &from, const Board &board) co
return moveList;
}
std::vector<Move> Queen::getLegalMoves(const Square &from, const Board &board) const {
std::vector<Move> Queen::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList;
return moveList;
}
std::vector<Move> Knight::getLegalMoves(const Square &from, const Board &board) const {
std::vector<Move> Knight::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList;
return moveList;
}
std::vector<Move> Bishop::getLegalMoves(const Square &from, const Board &board) const {
std::vector<Move> Bishop::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList;
return moveList;
}
std::vector<Move> Pawn::getLegalMoves(const Square &from, const Board &board) const {
std::vector<Move> Pawn::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList;
const int directions[2][4][2] = {
{