dev: Updates to Board and Piece, formatted code

This commit is contained in:
A.M. Rowsell 2025-09-07 17:59:16 -04:00
commit f05dd6d90f
Signed by untrusted user who does not match committer: amr
GPG key ID: E0879EDBDB0CA7B1
6 changed files with 122 additions and 121 deletions

107
Piece.cpp
View file

@ -35,17 +35,16 @@ bool Piece::finalMoveChecks(std::vector<Move> *moveList, Board &board) {
}
// *INDENT-OFF*
// ##
// ## ##
// ##
// ## ## ## # ## ####
// ## # ## ## ## ## #
// ### ## ## ## ## #
// ## # ## ## ## ###
// ## ## ## ## ### ##
// ####
// # #
// ####
//
// ## #
// #
// # ## ## # ## ## #
// # # # # # # #
// ## # # # # #
// # # # # # # #
// ## ## ##### ### ## ###
// #
// ###
// *INDENT-ON*
bool King::checkForCheck(Board &board) const {
std::vector<std::vector<int>> kingVulnerable = {
@ -182,13 +181,15 @@ std::vector<Move> King::getLegalMoves(const Square &from, Board &board) const {
}
// *INDENT-OFF*
// ##
// ##
// ## # ### ### ## ##
// #### ## ## ## ## ## #
// ## ## ## ## ## ###
// ## ## ## ## ## ## #
// ## ### ### ## ##
//
// ##
// #
// # ### ## ## # ##
// # # # # # # #
// # # # # # ##
// # # # # # # #
// #### ## ## ## ##
//
// *INDENT-OM*
std::vector<Move> Rook::getLegalMoves(const Square &from, Board &board) const {
@ -222,13 +223,13 @@ std::vector<Move> Rook::getLegalMoves(const Square &from, Board &board) const {
}
// *INDENT-OFF*
// ### ## ## ### ### # ##
// ## # ## # ## # ## # ## ##
// ## # ## # #### #### ## ##
// ## # ## # ## ## ## ##
// ### ### ### ### ## ###
// ##
// ###
// ## # ## ## ## ## # ##
// # # # # # # # # # #
// # # # # ### ### # #
// # # # # # # # #
// ### ## # ### ### ### ##
// #
// ###
// *INDENT-ON*
std::vector<Move> Queen::getLegalMoves(const Square &from, Board &board) const {
@ -269,18 +270,15 @@ std::vector<Move> Queen::getLegalMoves(const Square &from, Board &board) const {
}
// *INDENT-OFF*
//
// ##
// ## ## ## #
// ## ## ##
// ## ## # ## ## #### #### ###
// ## # ## ## ## ## # ## # ##
// ### ## ## ## ## # ## # ##
// ## # ## ## ## ### ## # ##
// ## ## ## ### ## ## ## ## ##
// ####
// # #
// ####
// ## # ## #
// # # #
// # ## # ## ## ## # ### ####
// # # # # # # # # # #
// ## # # # # # # # #
// # # # # # # # # # # #
// ## ## ### ## ##### ### ### ## ##
// #
// ###
// *INDENT-ON*
std::vector<Move> Knight::getLegalMoves(const Square &from, Board &board) const {
@ -299,17 +297,15 @@ std::vector<Move> Knight::getLegalMoves(const Square &from, Board &board) const
}
// *INDENT-OFF*
//
// ##
// ## ## ##
// ## ##
// ### ## ## #### ### ###
// ## # ## ## ## # ## ## ## #
// ## # ## ### ## # ## ## ## #
// ## # ## ## ## # ## ## ## #
// ### ## ### ## ## ### ###
// ##
// ###
// ## # ##
// # #
// ### ## ### ### ## # ##
// # # # # # # # # # #
// # # # ## # # # # # #
// # # # # # # # # # #
// #### ##### ### ### ## ## ###
// #
// ###
// *INDENT-ON*
std::vector<Move> Bishop::getLegalMoves(const Square &from, Board &board) const {
@ -324,13 +320,14 @@ std::vector<Move> Bishop::getLegalMoves(const Square &from, Board &board) const
}
// *INDENT-OFF*
// ### ## # # ## # ##
// ## # # ## # # # ## ##
// ## # ### # ### ## ##
// ## # # # #### ## ##
// ### ##### # # ## ###
// ##
// ###
//
// # ## ## # # ## # ##
// # # # # # # # #
// # # ### # # # # #
// # # # # # # # #
// ### ## # # # ### ##
// #
// ###
// *INDENT-ON*
std::vector<Move> Pawn::getLegalMoves(const Square &from, Board &board) const {